| // Copyright 2015 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #include "chrome/browser/ui/omnibox/chrome_omnibox_edit_controller.h" |
| |
| #include "build/build_config.h" |
| #include "chrome/app/chrome_command_ids.h" |
| #include "chrome/browser/command_updater.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/ui/browser.h" |
| #include "chrome/browser/ui/browser_list.h" |
| #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| #include "components/omnibox/browser/location_bar_model.h" |
| #include "extensions/buildflags/buildflags.h" |
| |
| #if BUILDFLAG(ENABLE_EXTENSIONS) |
| #include "chrome/browser/ui/extensions/settings_api_bubble_helpers.h" |
| #endif |
| |
| void ChromeOmniboxEditController::OnAutocompleteAccept( |
| const GURL& destination_url, |
| TemplateURLRef::PostContent* post_content, |
| WindowOpenDisposition disposition, |
| ui::PageTransition transition, |
| AutocompleteMatchType::Type match_type, |
| base::TimeTicks match_selection_timestamp) { |
| OmniboxEditController::OnAutocompleteAccept( |
| destination_url, post_content, disposition, transition, match_type, |
| match_selection_timestamp); |
| if (command_updater_) |
| command_updater_->ExecuteCommand(IDC_OPEN_CURRENT_URL); |
| |
| #if BUILDFLAG(ENABLE_EXTENSIONS) |
| extensions::MaybeShowExtensionControlledSearchNotification( |
| GetWebContents(), match_type); |
| #endif |
| } |
| |
| void ChromeOmniboxEditController::OnInputInProgress(bool in_progress) { |
| UpdateWithoutTabRestore(); |
| } |
| |
| content::WebContents* ChromeOmniboxEditController::GetWebContents() { |
| return nullptr; |
| } |
| |
| void ChromeOmniboxEditController::UpdateWithoutTabRestore() {} |
| |
| ChromeOmniboxEditController::ChromeOmniboxEditController( |
| CommandUpdater* command_updater) |
| : command_updater_(command_updater) {} |
| |
| ChromeOmniboxEditController::~ChromeOmniboxEditController() {} |