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

Side by Side Diff: chrome/browser/background/background_mode_manager.cc

Issue 8937001: Fixes for the kWasRestarted pref. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test build fix. 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
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 <string> 5 #include <string>
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 BackgroundModeData* bmd = background_mode_data_.begin()->second.get(); 461 BackgroundModeData* bmd = background_mode_data_.begin()->second.get();
462 switch (command_id) { 462 switch (command_id) {
463 case IDC_ABOUT: 463 case IDC_ABOUT:
464 bmd->GetBrowserWindow()->OpenAboutChromeDialog(); 464 bmd->GetBrowserWindow()->OpenAboutChromeDialog();
465 break; 465 break;
466 case IDC_TASK_MANAGER: 466 case IDC_TASK_MANAGER:
467 bmd->GetBrowserWindow()->OpenTaskManager(true); 467 bmd->GetBrowserWindow()->OpenTaskManager(true);
468 break; 468 break;
469 case IDC_EXIT: 469 case IDC_EXIT:
470 UserMetrics::RecordAction(UserMetricsAction("Exit")); 470 UserMetrics::RecordAction(UserMetricsAction("Exit"));
471 BrowserList::AttemptExit(false); 471 BrowserList::AttemptExit();
472 break; 472 break;
473 case IDC_STATUS_TRAY_KEEP_CHROME_RUNNING_IN_BACKGROUND: { 473 case IDC_STATUS_TRAY_KEEP_CHROME_RUNNING_IN_BACKGROUND: {
474 // Background mode must already be enabled (as otherwise this menu would 474 // Background mode must already be enabled (as otherwise this menu would
475 // not be visible). 475 // not be visible).
476 DCHECK(IsBackgroundModePrefEnabled()); 476 DCHECK(IsBackgroundModePrefEnabled());
477 DCHECK(BrowserList::WillKeepAlive()); 477 DCHECK(BrowserList::WillKeepAlive());
478 478
479 // Set the background mode pref to "disabled" - the resulting notification 479 // Set the background mode pref to "disabled" - the resulting notification
480 // will result in a call to DisableBackgroundMode(). 480 // will result in a call to DisableBackgroundMode().
481 PrefService* service = g_browser_process->local_state(); 481 PrefService* service = g_browser_process->local_state();
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 command_line->HasSwitch(switches::kDisableExtensions); 738 command_line->HasSwitch(switches::kDisableExtensions);
739 return background_mode_disabled; 739 return background_mode_disabled;
740 #endif 740 #endif
741 } 741 }
742 742
743 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { 743 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const {
744 PrefService* service = g_browser_process->local_state(); 744 PrefService* service = g_browser_process->local_state();
745 DCHECK(service); 745 DCHECK(service);
746 return service->GetBoolean(prefs::kBackgroundModeEnabled); 746 return service->GetBoolean(prefs::kBackgroundModeEnabled);
747 } 747 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698