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

Unified Diff: chrome/browser/background/background_mode_manager_win.cc

Issue 8680017: base::Bind: Convert BackgroundModeManager Tasks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win build fix. Created 9 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 | « chrome/browser/background/background_mode_manager_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/background/background_mode_manager_win.cc
diff --git a/chrome/browser/background/background_mode_manager_win.cc b/chrome/browser/background/background_mode_manager_win.cc
index 1596a11db41b8123b64b9974474e0d2137361de3..a27632a00582bfec2f37185dc879368705651eaf 100644
--- a/chrome/browser/background/background_mode_manager_win.cc
+++ b/chrome/browser/background/background_mode_manager_win.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/base_paths.h"
+#include "base/bind.h"
#include "base/command_line.h"
#include "base/file_path.h"
#include "base/logging.h"
@@ -22,22 +23,12 @@ using content::BrowserThread;
namespace {
-class DisableLaunchOnStartupTask : public Task {
- public:
- virtual void Run();
-};
-
-class EnableLaunchOnStartupTask : public Task {
- public:
- virtual void Run();
-};
-
const HKEY kBackgroundModeRegistryRootKey = HKEY_CURRENT_USER;
const wchar_t* kBackgroundModeRegistrySubkey =
L"Software\\Microsoft\\Windows\\CurrentVersion\\Run";
const wchar_t* kBackgroundModeRegistryKeyName = L"chromium";
-void DisableLaunchOnStartupTask::Run() {
+void DisableLaunchOnStartupCallback() {
const wchar_t* key_name = kBackgroundModeRegistryKeyName;
base::win::RegKey read_key(kBackgroundModeRegistryRootKey,
kBackgroundModeRegistrySubkey, KEY_READ);
@@ -50,7 +41,7 @@ void DisableLaunchOnStartupTask::Run() {
}
}
-void EnableLaunchOnStartupTask::Run() {
+void EnableLaunchOnStartupCallback() {
// TODO(rickcam): Bug 53597: Make RegKey mockable.
// TODO(rickcam): Bug 53600: Use distinct registry keys per flavor+profile.
const wchar_t* key_name = kBackgroundModeRegistryKeyName;
@@ -83,10 +74,10 @@ void BackgroundModeManager::EnableLaunchOnStartup(bool should_launch) {
return;
if (should_launch) {
BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
- new EnableLaunchOnStartupTask());
+ base::Bind(EnableLaunchOnStartupCallback));
} else {
BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
- new DisableLaunchOnStartupTask());
+ base::Bind(DisableLaunchOnStartupCallback));
}
}
« no previous file with comments | « chrome/browser/background/background_mode_manager_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698