OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |