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

Side by Side Diff: chrome/browser/browser_shutdown.cc

Issue 6905044: Refactor preference syncing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review Created 9 years, 8 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 | 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 "chrome/browser/browser_shutdown.h" 5 #include "chrome/browser/browser_shutdown.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 Time shutdown_started_; 66 Time shutdown_started_;
67 ShutdownType shutdown_type_ = NOT_VALID; 67 ShutdownType shutdown_type_ = NOT_VALID;
68 int shutdown_num_processes_; 68 int shutdown_num_processes_;
69 int shutdown_num_processes_slow_; 69 int shutdown_num_processes_slow_;
70 70
71 bool delete_resources_on_shutdown = true; 71 bool delete_resources_on_shutdown = true;
72 72
73 const char kShutdownMsFile[] = "chrome_shutdown_ms.txt"; 73 const char kShutdownMsFile[] = "chrome_shutdown_ms.txt";
74 74
75 void RegisterPrefs(PrefService* local_state) { 75 void RegisterPrefs(PrefService* local_state) {
76 local_state->RegisterIntegerPref(prefs::kShutdownType, NOT_VALID); 76 local_state->RegisterIntegerPref(prefs::kShutdownType,
77 local_state->RegisterIntegerPref(prefs::kShutdownNumProcesses, 0); 77 NOT_VALID,
78 local_state->RegisterIntegerPref(prefs::kShutdownNumProcessesSlow, 0); 78 false /* don't sync pref */);
79 local_state->RegisterIntegerPref(prefs::kShutdownNumProcesses,
80 0,
81 false /* don't sync pref */);
82 local_state->RegisterIntegerPref(prefs::kShutdownNumProcessesSlow,
83 0,
84 false /* don't sync pref */);
79 } 85 }
80 86
81 ShutdownType GetShutdownType() { 87 ShutdownType GetShutdownType() {
82 return shutdown_type_; 88 return shutdown_type_;
83 } 89 }
84 90
85 void OnShutdownStarting(ShutdownType type) { 91 void OnShutdownStarting(ShutdownType type) {
86 if (shutdown_type_ != NOT_VALID) 92 if (shutdown_type_ != NOT_VALID)
87 return; 93 return;
88 94
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 338
333 bool ShuttingDownWithoutClosingBrowsers() { 339 bool ShuttingDownWithoutClosingBrowsers() {
334 #if defined(USE_X11) 340 #if defined(USE_X11)
335 if (GetShutdownType() == browser_shutdown::END_SESSION) 341 if (GetShutdownType() == browser_shutdown::END_SESSION)
336 return true; 342 return true;
337 #endif 343 #endif
338 return false; 344 return false;
339 } 345 }
340 346
341 } // namespace browser_shutdown 347 } // namespace browser_shutdown
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698