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

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

Issue 1725883002: Add KeepAliveStateObserver, add the Restart option (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@KeepAlive
Patch Set: Created 4 years, 10 months 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
OLDNEW
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/background/background_mode_manager.h" 5 #include "chrome/browser/background/background_mode_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // previously logged data. When making changes, also update histograms.xml. 79 // previously logged data. When making changes, also update histograms.xml.
80 enum MenuItem { 80 enum MenuItem {
81 MENU_ITEM_ABOUT = 0, 81 MENU_ITEM_ABOUT = 0,
82 MENU_ITEM_TASK_MANAGER = 1, 82 MENU_ITEM_TASK_MANAGER = 1,
83 MENU_ITEM_BACKGROUND_CLIENT = 2, 83 MENU_ITEM_BACKGROUND_CLIENT = 2,
84 MENU_ITEM_KEEP_RUNNING = 3, 84 MENU_ITEM_KEEP_RUNNING = 3,
85 MENU_ITEM_EXIT = 4, 85 MENU_ITEM_EXIT = 4,
86 MENU_ITEM_NUM_STATES 86 MENU_ITEM_NUM_STATES
87 }; 87 };
88 88
89 const KeepAliveOptions kKeepAliveOptions = {"Background"}; 89 const KeepAliveOptions kKeepAliveOptions = {"Background",
90 KeepAliveOptionRestart::ENABLED};
90 91
91 void RecordMenuItemClick(MenuItem item) { 92 void RecordMenuItemClick(MenuItem item) {
92 UMA_HISTOGRAM_ENUMERATION("BackgroundMode.MenuItemClick", item, 93 UMA_HISTOGRAM_ENUMERATION("BackgroundMode.MenuItemClick", item,
93 MENU_ITEM_NUM_STATES); 94 MENU_ITEM_NUM_STATES);
94 } 95 }
95 } // namespace 96 } // namespace
96 97
97 BackgroundModeManager::BackgroundModeData::BackgroundModeData( 98 BackgroundModeManager::BackgroundModeData::BackgroundModeData(
98 Profile* profile, 99 Profile* profile,
99 CommandIdHandlerVector* command_id_handler_vector) 100 CommandIdHandlerVector* command_id_handler_vector)
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 } 1027 }
1027 } 1028 }
1028 return profile_it; 1029 return profile_it;
1029 } 1030 }
1030 1031
1031 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { 1032 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const {
1032 PrefService* service = g_browser_process->local_state(); 1033 PrefService* service = g_browser_process->local_state();
1033 DCHECK(service); 1034 DCHECK(service);
1034 return service->GetBoolean(prefs::kBackgroundModeEnabled); 1035 return service->GetBoolean(prefs::kBackgroundModeEnabled);
1035 } 1036 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/lifetime/keep_alive_options.h » ('j') | chrome/browser/lifetime/keep_alive_options.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698