OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/omnibox/chrome_omnibox_edit_controller.h" | 5 #include "chrome/browser/ui/omnibox/chrome_omnibox_edit_controller.h" |
6 | 6 |
7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
8 #include "chrome/browser/command_updater.h" | 8 #include "chrome/browser/command_updater.h" |
9 #include "components/toolbar/toolbar_model.h" | 9 #include "components/toolbar/toolbar_model.h" |
| 10 #include "extensions/features/features.h" |
10 | 11 |
11 #if defined(ENABLE_EXTENSIONS) | 12 #if BUILDFLAG(ENABLE_EXTENSIONS) |
12 #include "chrome/browser/ui/extensions/settings_api_bubble_helpers.h" | 13 #include "chrome/browser/ui/extensions/settings_api_bubble_helpers.h" |
13 #endif | 14 #endif |
14 | 15 |
15 ChromeOmniboxEditController::ChromeOmniboxEditController( | 16 ChromeOmniboxEditController::ChromeOmniboxEditController( |
16 CommandUpdater* command_updater) | 17 CommandUpdater* command_updater) |
17 : command_updater_(command_updater) {} | 18 : command_updater_(command_updater) {} |
18 | 19 |
19 ChromeOmniboxEditController::~ChromeOmniboxEditController() {} | 20 ChromeOmniboxEditController::~ChromeOmniboxEditController() {} |
20 | 21 |
21 void ChromeOmniboxEditController::OnAutocompleteAccept( | 22 void ChromeOmniboxEditController::OnAutocompleteAccept( |
22 const GURL& destination_url, | 23 const GURL& destination_url, |
23 WindowOpenDisposition disposition, | 24 WindowOpenDisposition disposition, |
24 ui::PageTransition transition, | 25 ui::PageTransition transition, |
25 AutocompleteMatchType::Type match_type) { | 26 AutocompleteMatchType::Type match_type) { |
26 OmniboxEditController::OnAutocompleteAccept(destination_url, disposition, | 27 OmniboxEditController::OnAutocompleteAccept(destination_url, disposition, |
27 transition, match_type); | 28 transition, match_type); |
28 if (command_updater_) | 29 if (command_updater_) |
29 command_updater_->ExecuteCommand(IDC_OPEN_CURRENT_URL); | 30 command_updater_->ExecuteCommand(IDC_OPEN_CURRENT_URL); |
30 | 31 |
31 #if defined(ENABLE_EXTENSIONS) | 32 #if BUILDFLAG(ENABLE_EXTENSIONS) |
32 extensions::MaybeShowExtensionControlledSearchNotification( | 33 extensions::MaybeShowExtensionControlledSearchNotification( |
33 GetWebContents(), match_type); | 34 GetWebContents(), match_type); |
34 #endif | 35 #endif |
35 } | 36 } |
36 | 37 |
37 void ChromeOmniboxEditController::OnInputInProgress(bool in_progress) { | 38 void ChromeOmniboxEditController::OnInputInProgress(bool in_progress) { |
38 GetToolbarModel()->set_input_in_progress(in_progress); | 39 GetToolbarModel()->set_input_in_progress(in_progress); |
39 UpdateWithoutTabRestore(); | 40 UpdateWithoutTabRestore(); |
40 } | 41 } |
OLD | NEW |