OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser_command_controller.h" | 5 #include "chrome/browser/ui/browser_command_controller.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/debug/debugging_flags.h" | 12 #include "base/debug/debugging_flags.h" |
13 #include "base/debug/profiler.h" | 13 #include "base/debug/profiler.h" |
14 #include "base/feature_list.h" | |
15 #include "base/macros.h" | 14 #include "base/macros.h" |
16 #include "base/metrics/user_metrics.h" | 15 #include "base/metrics/user_metrics.h" |
17 #include "build/build_config.h" | 16 #include "build/build_config.h" |
18 #include "chrome/app/chrome_command_ids.h" | 17 #include "chrome/app/chrome_command_ids.h" |
19 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
20 #include "chrome/browser/chrome_notification_types.h" | 19 #include "chrome/browser/chrome_notification_types.h" |
21 #include "chrome/browser/defaults.h" | 20 #include "chrome/browser/defaults.h" |
22 #include "chrome/browser/extensions/extension_service.h" | 21 #include "chrome/browser/extensions/extension_service.h" |
23 #include "chrome/browser/extensions/extension_util.h" | 22 #include "chrome/browser/extensions/extension_util.h" |
24 #include "chrome/browser/lifetime/application_lifetime.h" | 23 #include "chrome/browser/lifetime/application_lifetime.h" |
25 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 24 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
26 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
27 #include "chrome/browser/profiles/profile_manager.h" | 26 #include "chrome/browser/profiles/profile_manager.h" |
28 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 27 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
29 #include "chrome/browser/shell_integration.h" | 28 #include "chrome/browser/shell_integration.h" |
30 #include "chrome/browser/signin/signin_promo.h" | 29 #include "chrome/browser/signin/signin_promo.h" |
31 #include "chrome/browser/sync/profile_sync_service_factory.h" | 30 #include "chrome/browser/sync/profile_sync_service_factory.h" |
32 #include "chrome/browser/ui/ash/ash_util.h" | 31 #include "chrome/browser/ui/ash/ash_util.h" |
33 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 32 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
34 #include "chrome/browser/ui/browser.h" | 33 #include "chrome/browser/ui/browser.h" |
35 #include "chrome/browser/ui/browser_commands.h" | 34 #include "chrome/browser/ui/browser_commands.h" |
36 #include "chrome/browser/ui/browser_window.h" | 35 #include "chrome/browser/ui/browser_window.h" |
37 #include "chrome/browser/ui/chrome_pages.h" | 36 #include "chrome/browser/ui/chrome_pages.h" |
38 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 37 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
39 #include "chrome/browser/ui/webui/inspect_ui.h" | 38 #include "chrome/browser/ui/webui/inspect_ui.h" |
40 #include "chrome/common/chrome_features.h" | |
41 #include "chrome/common/content_restriction.h" | 39 #include "chrome/common/content_restriction.h" |
42 #include "chrome/common/pref_names.h" | 40 #include "chrome/common/pref_names.h" |
43 #include "chrome/common/profiling.h" | 41 #include "chrome/common/profiling.h" |
44 #include "components/bookmarks/common/bookmark_pref_names.h" | 42 #include "components/bookmarks/common/bookmark_pref_names.h" |
45 #include "components/browser_sync/profile_sync_service.h" | 43 #include "components/browser_sync/profile_sync_service.h" |
46 #include "components/dom_distiller/core/dom_distiller_switches.h" | 44 #include "components/dom_distiller/core/dom_distiller_switches.h" |
47 #include "components/prefs/pref_service.h" | 45 #include "components/prefs/pref_service.h" |
48 #include "components/sessions/core/tab_restore_service.h" | 46 #include "components/sessions/core/tab_restore_service.h" |
49 #include "components/signin/core/common/signin_pref_names.h" | 47 #include "components/signin/core/common/signin_pref_names.h" |
50 #include "content/public/browser/native_web_keyboard_event.h" | 48 #include "content/public/browser/native_web_keyboard_event.h" |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 last_blocked_command_id_ = id; | 299 last_blocked_command_id_ = id; |
302 last_blocked_command_disposition_ = disposition; | 300 last_blocked_command_disposition_ = disposition; |
303 return; | 301 return; |
304 } | 302 } |
305 | 303 |
306 // The order of commands in this switch statement must match the function | 304 // The order of commands in this switch statement must match the function |
307 // declaration order in browser.h! | 305 // declaration order in browser.h! |
308 switch (id) { | 306 switch (id) { |
309 // Navigation commands | 307 // Navigation commands |
310 case IDC_BACKSPACE_BACK: | 308 case IDC_BACKSPACE_BACK: |
311 if (base::FeatureList::IsEnabled(features::kBackspaceGoesBackFeature)) | 309 window()->MaybeShowNewBackShortcutBubble(false); |
312 GoBack(browser_, disposition); | |
313 else | |
314 window()->MaybeShowNewBackShortcutBubble(false); | |
315 break; | 310 break; |
316 case IDC_BACK: | 311 case IDC_BACK: |
317 window()->HideNewBackShortcutBubble(); | 312 window()->HideNewBackShortcutBubble(); |
318 GoBack(browser_, disposition); | 313 GoBack(browser_, disposition); |
319 break; | 314 break; |
320 case IDC_BACKSPACE_FORWARD: | 315 case IDC_BACKSPACE_FORWARD: |
321 if (base::FeatureList::IsEnabled(features::kBackspaceGoesBackFeature)) | 316 window()->MaybeShowNewBackShortcutBubble(true); |
322 GoForward(browser_, disposition); | |
323 else | |
324 window()->MaybeShowNewBackShortcutBubble(true); | |
325 break; | 317 break; |
326 case IDC_FORWARD: | 318 case IDC_FORWARD: |
327 window()->HideNewBackShortcutBubble(); | 319 window()->HideNewBackShortcutBubble(); |
328 GoForward(browser_, disposition); | 320 GoForward(browser_, disposition); |
329 break; | 321 break; |
330 case IDC_RELOAD: | 322 case IDC_RELOAD: |
331 Reload(browser_, disposition); | 323 Reload(browser_, disposition); |
332 break; | 324 break; |
333 case IDC_RELOAD_CLEARING_CACHE: | 325 case IDC_RELOAD_CLEARING_CACHE: |
334 ClearCache(browser_); | 326 ClearCache(browser_); |
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 | 1159 |
1168 BrowserWindow* BrowserCommandController::window() { | 1160 BrowserWindow* BrowserCommandController::window() { |
1169 return browser_->window(); | 1161 return browser_->window(); |
1170 } | 1162 } |
1171 | 1163 |
1172 Profile* BrowserCommandController::profile() { | 1164 Profile* BrowserCommandController::profile() { |
1173 return browser_->profile(); | 1165 return browser_->profile(); |
1174 } | 1166 } |
1175 | 1167 |
1176 } // namespace chrome | 1168 } // namespace chrome |
OLD | NEW |