Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 8834006: Add shutdown option to wrench menu. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: build break Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/toolbar/wrench_menu_model_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 #endif // OS_WIN 182 #endif // OS_WIN
183 183
184 #if defined(OS_MACOSX) 184 #if defined(OS_MACOSX)
185 #include "content/browser/find_pasteboard.h" 185 #include "content/browser/find_pasteboard.h"
186 #endif 186 #endif
187 187
188 #if defined(OS_CHROMEOS) 188 #if defined(OS_CHROMEOS)
189 #include "chrome/browser/chromeos/boot_times_loader.h" 189 #include "chrome/browser/chromeos/boot_times_loader.h"
190 #include "chrome/browser/chromeos/cros/cros_library.h" 190 #include "chrome/browser/chromeos/cros/cros_library.h"
191 #include "chrome/browser/chromeos/cros/screen_lock_library.h" 191 #include "chrome/browser/chromeos/cros/screen_lock_library.h"
192 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h"
193 #include "chrome/browser/chromeos/dbus/power_manager_client.h"
192 #include "chrome/browser/ui/webui/active_downloads_ui.h" 194 #include "chrome/browser/ui/webui/active_downloads_ui.h"
193 #endif 195 #endif
194 196
195 #if !defined(OS_CHROMEOS) || defined(USE_AURA) 197 #if !defined(OS_CHROMEOS) || defined(USE_AURA)
196 #include "chrome/browser/download/download_shelf.h" 198 #include "chrome/browser/download/download_shelf.h"
197 #endif 199 #endif
198 200
199 #if defined(FILE_MANAGER_EXTENSION) 201 #if defined(FILE_MANAGER_EXTENSION)
200 #include "chrome/browser/extensions/file_manager_util.h" 202 #include "chrome/browser/extensions/file_manager_util.h"
201 #endif 203 #endif
(...skipping 2036 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 } 2240 }
2239 #endif 2241 #endif
2240 2242
2241 #if defined(OS_CHROMEOS) 2243 #if defined(OS_CHROMEOS)
2242 void Browser::LockScreen() { 2244 void Browser::LockScreen() {
2243 UserMetrics::RecordAction(UserMetricsAction("LockScreen")); 2245 UserMetrics::RecordAction(UserMetricsAction("LockScreen"));
2244 chromeos::CrosLibrary::Get()->GetScreenLockLibrary()-> 2246 chromeos::CrosLibrary::Get()->GetScreenLockLibrary()->
2245 NotifyScreenLockRequested(); 2247 NotifyScreenLockRequested();
2246 } 2248 }
2247 2249
2250 void Browser::Shutdown() {
2251 UserMetrics::RecordAction(UserMetricsAction("Shutdown"));
2252 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->
2253 RequestShutdown();
2254 }
2255
2248 void Browser::OpenSystemOptionsDialog() { 2256 void Browser::OpenSystemOptionsDialog() {
2249 UserMetrics::RecordAction(UserMetricsAction("OpenSystemOptionsDialog")); 2257 UserMetrics::RecordAction(UserMetricsAction("OpenSystemOptionsDialog"));
2250 ShowOptionsTab(chrome::kSystemOptionsSubPage); 2258 ShowOptionsTab(chrome::kSystemOptionsSubPage);
2251 } 2259 }
2252 2260
2253 void Browser::OpenInternetOptionsDialog() { 2261 void Browser::OpenInternetOptionsDialog() {
2254 UserMetrics::RecordAction(UserMetricsAction("OpenInternetOptionsDialog")); 2262 UserMetrics::RecordAction(UserMetricsAction("OpenInternetOptionsDialog"));
2255 ShowOptionsTab(chrome::kInternetOptionsSubPage); 2263 ShowOptionsTab(chrome::kInternetOptionsSubPage);
2256 } 2264 }
2257 2265
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
2843 case IDC_EDIT_SEARCH_ENGINES: OpenSearchEngineOptionsDialog(); break; 2851 case IDC_EDIT_SEARCH_ENGINES: OpenSearchEngineOptionsDialog(); break;
2844 case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break; 2852 case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break;
2845 case IDC_CLEAR_BROWSING_DATA: OpenClearBrowsingDataDialog(); break; 2853 case IDC_CLEAR_BROWSING_DATA: OpenClearBrowsingDataDialog(); break;
2846 case IDC_IMPORT_SETTINGS: OpenImportSettingsDialog(); break; 2854 case IDC_IMPORT_SETTINGS: OpenImportSettingsDialog(); break;
2847 case IDC_ABOUT: OpenAboutChromeDialog(); break; 2855 case IDC_ABOUT: OpenAboutChromeDialog(); break;
2848 case IDC_UPGRADE_DIALOG: OpenUpdateChromeDialog(); break; 2856 case IDC_UPGRADE_DIALOG: OpenUpdateChromeDialog(); break;
2849 case IDC_VIEW_INCOMPATIBILITIES: ShowAboutConflictsTab(); break; 2857 case IDC_VIEW_INCOMPATIBILITIES: ShowAboutConflictsTab(); break;
2850 case IDC_HELP_PAGE: ShowHelpTab(); break; 2858 case IDC_HELP_PAGE: ShowHelpTab(); break;
2851 #if defined(OS_CHROMEOS) 2859 #if defined(OS_CHROMEOS)
2852 case IDC_LOCK_SCREEN: LockScreen(); break; 2860 case IDC_LOCK_SCREEN: LockScreen(); break;
2861 case IDC_SHUTDOWN: Shutdown(); break;
2853 case IDC_FILE_MANAGER: OpenFileManager(); break; 2862 case IDC_FILE_MANAGER: OpenFileManager(); break;
2854 case IDC_SYSTEM_OPTIONS: OpenSystemOptionsDialog(); break; 2863 case IDC_SYSTEM_OPTIONS: OpenSystemOptionsDialog(); break;
2855 case IDC_INTERNET_OPTIONS: OpenInternetOptionsDialog(); break; 2864 case IDC_INTERNET_OPTIONS: OpenInternetOptionsDialog(); break;
2856 case IDC_LANGUAGE_OPTIONS: OpenLanguageOptionsDialog(); break; 2865 case IDC_LANGUAGE_OPTIONS: OpenLanguageOptionsDialog(); break;
2857 #endif 2866 #endif
2858 case IDC_SHOW_SYNC_SETUP: ShowSyncSetup(); break; 2867 case IDC_SHOW_SYNC_SETUP: ShowSyncSetup(); break;
2859 case IDC_TOGGLE_SPEECH_INPUT: ToggleSpeechInput(); break; 2868 case IDC_TOGGLE_SPEECH_INPUT: ToggleSpeechInput(); break;
2860 2869
2861 default: 2870 default:
2862 LOG(WARNING) << "Received Unimplemented Command: " << id; 2871 LOG(WARNING) << "Received Unimplemented Command: " << id;
(...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after
4358 command_updater_.UpdateCommandEnabled(IDC_CREATE_SHORTCUTS, false); 4367 command_updater_.UpdateCommandEnabled(IDC_CREATE_SHORTCUTS, false);
4359 UpdateCommandsForDevTools(); 4368 UpdateCommandsForDevTools();
4360 command_updater_.UpdateCommandEnabled(IDC_TASK_MANAGER, true); 4369 command_updater_.UpdateCommandEnabled(IDC_TASK_MANAGER, true);
4361 command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY, true); 4370 command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY, true);
4362 command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true); 4371 command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true);
4363 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE, true); 4372 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE, true);
4364 command_updater_.UpdateCommandEnabled(IDC_BOOKMARKS_MENU, true); 4373 command_updater_.UpdateCommandEnabled(IDC_BOOKMARKS_MENU, true);
4365 4374
4366 #if defined(OS_CHROMEOS) 4375 #if defined(OS_CHROMEOS)
4367 command_updater_.UpdateCommandEnabled(IDC_LOCK_SCREEN, true); 4376 command_updater_.UpdateCommandEnabled(IDC_LOCK_SCREEN, true);
4377 command_updater_.UpdateCommandEnabled(IDC_SHUTDOWN, true);
4368 command_updater_.UpdateCommandEnabled(IDC_FILE_MANAGER, true); 4378 command_updater_.UpdateCommandEnabled(IDC_FILE_MANAGER, true);
4369 command_updater_.UpdateCommandEnabled(IDC_SEARCH, true); 4379 command_updater_.UpdateCommandEnabled(IDC_SEARCH, true);
4370 command_updater_.UpdateCommandEnabled(IDC_SHOW_KEYBOARD_OVERLAY, true); 4380 command_updater_.UpdateCommandEnabled(IDC_SHOW_KEYBOARD_OVERLAY, true);
4371 command_updater_.UpdateCommandEnabled(IDC_SYSTEM_OPTIONS, true); 4381 command_updater_.UpdateCommandEnabled(IDC_SYSTEM_OPTIONS, true);
4372 command_updater_.UpdateCommandEnabled(IDC_INTERNET_OPTIONS, true); 4382 command_updater_.UpdateCommandEnabled(IDC_INTERNET_OPTIONS, true);
4373 #endif 4383 #endif
4374 command_updater_.UpdateCommandEnabled( 4384 command_updater_.UpdateCommandEnabled(
4375 IDC_SHOW_SYNC_SETUP, profile_->GetOriginalProfile()->IsSyncAccessible()); 4385 IDC_SHOW_SYNC_SETUP, profile_->GetOriginalProfile()->IsSyncAccessible());
4376 4386
4377 // Initialize other commands based on the window type. 4387 // Initialize other commands based on the window type.
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after
5319 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); 5329 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type);
5320 } else { 5330 } else {
5321 GlobalErrorService* service = 5331 GlobalErrorService* service =
5322 GlobalErrorServiceFactory::GetForProfile(profile()); 5332 GlobalErrorServiceFactory::GetForProfile(profile());
5323 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); 5333 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView();
5324 if (error) { 5334 if (error) {
5325 error->ShowBubbleView(this); 5335 error->ShowBubbleView(this);
5326 } 5336 }
5327 } 5337 }
5328 } 5338 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/toolbar/wrench_menu_model_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698