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

Unified Diff: chrome/browser/background_mode_manager.cc

Issue 4850001: Corrected bad DCHECK range check in BackgroundModeManager::ExecuteApplication. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added Task Manager entry to Status Icon's context menu. Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/background_mode_manager.cc
diff --git a/chrome/browser/background_mode_manager.cc b/chrome/browser/background_mode_manager.cc
index 06e54395d9051feecf6f1a4b3737b07e5a780c73..b9cb9110455c1f2ae99e0209881be011ea966692 100644
--- a/chrome/browser/background_mode_manager.cc
+++ b/chrome/browser/background_mode_manager.cc
@@ -498,6 +498,7 @@ void BackgroundModeManager::UpdateStatusTrayIconContextMenu() {
menu->AddItemWithStringId(IDC_OPTIONS, IDS_OPTIONS);
#endif
}
+ menu->AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER);
menu->AddSeparator();
int application_position = 0;
context_menu_application_offset_ = menu->GetItemCount();
@@ -541,7 +542,7 @@ void BackgroundModeManager::RemoveStatusTrayIcon() {
}
void BackgroundModeManager::ExecuteApplication(int item) {
- DCHECK(item > 0 && item < static_cast<int>(applications_.size()));
+ DCHECK(item >= 0 && item < static_cast<int>(applications_.size()));
Browser* browser = BrowserList::GetLastActive();
if (!browser) {
Browser::OpenEmptyWindow(profile_);
@@ -553,16 +554,19 @@ void BackgroundModeManager::ExecuteApplication(int item) {
void BackgroundModeManager::ExecuteCommand(int item) {
switch (item) {
+ case IDC_ABOUT:
+ GetBrowserWindow()->OpenAboutChromeDialog();
+ break;
case IDC_EXIT:
UserMetrics::RecordAction(UserMetricsAction("Exit"), profile_);
BrowserList::CloseAllBrowsersAndExit();
break;
- case IDC_ABOUT:
- GetBrowserWindow()->OpenAboutChromeDialog();
- break;
case IDC_OPTIONS:
GetBrowserWindow()->OpenOptionsDialog();
break;
+ case IDC_TASK_MANAGER:
+ GetBrowserWindow()->OpenTaskManager();
+ break;
default:
ExecuteApplication(item);
break;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698