| 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.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #endif // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 2165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2176 void Browser::FocusLocationBar() { | 2176 void Browser::FocusLocationBar() { |
| 2177 content::RecordAction(UserMetricsAction("FocusLocation")); | 2177 content::RecordAction(UserMetricsAction("FocusLocation")); |
| 2178 window_->SetFocusToLocationBar(true); | 2178 window_->SetFocusToLocationBar(true); |
| 2179 } | 2179 } |
| 2180 | 2180 |
| 2181 void Browser::FocusBookmarksToolbar() { | 2181 void Browser::FocusBookmarksToolbar() { |
| 2182 content::RecordAction(UserMetricsAction("FocusBookmarksToolbar")); | 2182 content::RecordAction(UserMetricsAction("FocusBookmarksToolbar")); |
| 2183 window_->FocusBookmarksToolbar(); | 2183 window_->FocusBookmarksToolbar(); |
| 2184 } | 2184 } |
| 2185 | 2185 |
| 2186 void Browser::FocusChromeOSStatus() { | |
| 2187 content::RecordAction(UserMetricsAction("FocusChromeOSStatus")); | |
| 2188 window_->FocusChromeOSStatus(); | |
| 2189 } | |
| 2190 | |
| 2191 void Browser::FocusNextPane() { | 2186 void Browser::FocusNextPane() { |
| 2192 content::RecordAction(UserMetricsAction("FocusNextPane")); | 2187 content::RecordAction(UserMetricsAction("FocusNextPane")); |
| 2193 window_->RotatePaneFocus(true); | 2188 window_->RotatePaneFocus(true); |
| 2194 } | 2189 } |
| 2195 | 2190 |
| 2196 void Browser::FocusPreviousPane() { | 2191 void Browser::FocusPreviousPane() { |
| 2197 content::RecordAction(UserMetricsAction("FocusPreviousPane")); | 2192 content::RecordAction(UserMetricsAction("FocusPreviousPane")); |
| 2198 window_->RotatePaneFocus(false); | 2193 window_->RotatePaneFocus(false); |
| 2199 } | 2194 } |
| 2200 | 2195 |
| (...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3202 case IDC_ZOOM_PLUS: Zoom(content::PAGE_ZOOM_IN); break; | 3197 case IDC_ZOOM_PLUS: Zoom(content::PAGE_ZOOM_IN); break; |
| 3203 case IDC_ZOOM_NORMAL: Zoom(content::PAGE_ZOOM_RESET); break; | 3198 case IDC_ZOOM_NORMAL: Zoom(content::PAGE_ZOOM_RESET); break; |
| 3204 case IDC_ZOOM_MINUS: Zoom(content::PAGE_ZOOM_OUT); break; | 3199 case IDC_ZOOM_MINUS: Zoom(content::PAGE_ZOOM_OUT); break; |
| 3205 | 3200 |
| 3206 // Focus various bits of UI | 3201 // Focus various bits of UI |
| 3207 case IDC_FOCUS_TOOLBAR: FocusToolbar(); break; | 3202 case IDC_FOCUS_TOOLBAR: FocusToolbar(); break; |
| 3208 case IDC_FOCUS_LOCATION: FocusLocationBar(); break; | 3203 case IDC_FOCUS_LOCATION: FocusLocationBar(); break; |
| 3209 case IDC_FOCUS_SEARCH: FocusSearch(); break; | 3204 case IDC_FOCUS_SEARCH: FocusSearch(); break; |
| 3210 case IDC_FOCUS_MENU_BAR: FocusAppMenu(); break; | 3205 case IDC_FOCUS_MENU_BAR: FocusAppMenu(); break; |
| 3211 case IDC_FOCUS_BOOKMARKS: FocusBookmarksToolbar(); break; | 3206 case IDC_FOCUS_BOOKMARKS: FocusBookmarksToolbar(); break; |
| 3212 case IDC_FOCUS_CHROMEOS_STATUS: FocusChromeOSStatus(); break; | |
| 3213 case IDC_FOCUS_NEXT_PANE: FocusNextPane(); break; | 3207 case IDC_FOCUS_NEXT_PANE: FocusNextPane(); break; |
| 3214 case IDC_FOCUS_PREVIOUS_PANE: FocusPreviousPane(); break; | 3208 case IDC_FOCUS_PREVIOUS_PANE: FocusPreviousPane(); break; |
| 3215 | 3209 |
| 3216 // Show various bits of UI | 3210 // Show various bits of UI |
| 3217 case IDC_OPEN_FILE: OpenFile(); break; | 3211 case IDC_OPEN_FILE: OpenFile(); break; |
| 3218 case IDC_CREATE_SHORTCUTS: OpenCreateShortcutsDialog(); break; | 3212 case IDC_CREATE_SHORTCUTS: OpenCreateShortcutsDialog(); break; |
| 3219 case IDC_DEV_TOOLS: ToggleDevToolsWindow( | 3213 case IDC_DEV_TOOLS: ToggleDevToolsWindow( |
| 3220 DEVTOOLS_TOGGLE_ACTION_NONE); | 3214 DEVTOOLS_TOGGLE_ACTION_NONE); |
| 3221 break; | 3215 break; |
| 3222 case IDC_DEV_TOOLS_CONSOLE: ToggleDevToolsWindow( | 3216 case IDC_DEV_TOOLS_CONSOLE: ToggleDevToolsWindow( |
| (...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4884 command_updater_.UpdateCommandEnabled(IDC_FOCUS_LOCATION, show_main_ui); | 4878 command_updater_.UpdateCommandEnabled(IDC_FOCUS_LOCATION, show_main_ui); |
| 4885 command_updater_.UpdateCommandEnabled(IDC_FOCUS_SEARCH, show_main_ui); | 4879 command_updater_.UpdateCommandEnabled(IDC_FOCUS_SEARCH, show_main_ui); |
| 4886 command_updater_.UpdateCommandEnabled( | 4880 command_updater_.UpdateCommandEnabled( |
| 4887 IDC_FOCUS_MENU_BAR, main_not_fullscreen); | 4881 IDC_FOCUS_MENU_BAR, main_not_fullscreen); |
| 4888 command_updater_.UpdateCommandEnabled( | 4882 command_updater_.UpdateCommandEnabled( |
| 4889 IDC_FOCUS_NEXT_PANE, main_not_fullscreen); | 4883 IDC_FOCUS_NEXT_PANE, main_not_fullscreen); |
| 4890 command_updater_.UpdateCommandEnabled( | 4884 command_updater_.UpdateCommandEnabled( |
| 4891 IDC_FOCUS_PREVIOUS_PANE, main_not_fullscreen); | 4885 IDC_FOCUS_PREVIOUS_PANE, main_not_fullscreen); |
| 4892 command_updater_.UpdateCommandEnabled( | 4886 command_updater_.UpdateCommandEnabled( |
| 4893 IDC_FOCUS_BOOKMARKS, main_not_fullscreen); | 4887 IDC_FOCUS_BOOKMARKS, main_not_fullscreen); |
| 4894 command_updater_.UpdateCommandEnabled( | |
| 4895 IDC_FOCUS_CHROMEOS_STATUS, main_not_fullscreen); | |
| 4896 | 4888 |
| 4897 // Show various bits of UI | 4889 // Show various bits of UI |
| 4898 command_updater_.UpdateCommandEnabled(IDC_DEVELOPER_MENU, show_main_ui); | 4890 command_updater_.UpdateCommandEnabled(IDC_DEVELOPER_MENU, show_main_ui); |
| 4899 command_updater_.UpdateCommandEnabled(IDC_FEEDBACK, show_main_ui); | 4891 command_updater_.UpdateCommandEnabled(IDC_FEEDBACK, show_main_ui); |
| 4900 command_updater_.UpdateCommandEnabled(IDC_SHOW_SYNC_SETUP, | 4892 command_updater_.UpdateCommandEnabled(IDC_SHOW_SYNC_SETUP, |
| 4901 show_main_ui && profile_->GetOriginalProfile()->IsSyncAccessible()); | 4893 show_main_ui && profile_->GetOriginalProfile()->IsSyncAccessible()); |
| 4902 | 4894 |
| 4903 // Settings page/subpages are forced to open in normal mode. We disable these | 4895 // Settings page/subpages are forced to open in normal mode. We disable these |
| 4904 // commands when incognito is forced. | 4896 // commands when incognito is forced. |
| 4905 const bool options_enabled = show_main_ui && | 4897 const bool options_enabled = show_main_ui && |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5687 ShowSingletonTabOverwritingNTP(params); | 5679 ShowSingletonTabOverwritingNTP(params); |
| 5688 } else { | 5680 } else { |
| 5689 LoginUIServiceFactory::GetForProfile( | 5681 LoginUIServiceFactory::GetForProfile( |
| 5690 profile()->GetOriginalProfile())->ShowLoginUI(false); | 5682 profile()->GetOriginalProfile())->ShowLoginUI(false); |
| 5691 } | 5683 } |
| 5692 } | 5684 } |
| 5693 | 5685 |
| 5694 void Browser::ToggleSpeechInput() { | 5686 void Browser::ToggleSpeechInput() { |
| 5695 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); | 5687 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); |
| 5696 } | 5688 } |
| OLD | NEW |