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

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: Rebase + comments Created 9 years, 7 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 Time shutdown_started_; 67 Time shutdown_started_;
68 ShutdownType shutdown_type_ = NOT_VALID; 68 ShutdownType shutdown_type_ = NOT_VALID;
69 int shutdown_num_processes_; 69 int shutdown_num_processes_;
70 int shutdown_num_processes_slow_; 70 int shutdown_num_processes_slow_;
71 71
72 bool delete_resources_on_shutdown = true; 72 bool delete_resources_on_shutdown = true;
73 73
74 const char kShutdownMsFile[] = "chrome_shutdown_ms.txt"; 74 const char kShutdownMsFile[] = "chrome_shutdown_ms.txt";
75 75
76 void RegisterPrefs(PrefService* local_state) { 76 void RegisterPrefs(PrefService* local_state) {
77 local_state->RegisterIntegerPref(prefs::kShutdownType, NOT_VALID); 77 local_state->RegisterIntegerPref(prefs::kShutdownType,
78 local_state->RegisterIntegerPref(prefs::kShutdownNumProcesses, 0); 78 NOT_VALID,
79 local_state->RegisterIntegerPref(prefs::kShutdownNumProcessesSlow, 0); 79 false /* don't sync pref */);
80 local_state->RegisterIntegerPref(prefs::kShutdownNumProcesses,
81 0,
82 false /* don't sync pref */);
83 local_state->RegisterIntegerPref(prefs::kShutdownNumProcessesSlow,
84 0,
85 false /* don't sync pref */);
80 } 86 }
81 87
82 ShutdownType GetShutdownType() { 88 ShutdownType GetShutdownType() {
83 return shutdown_type_; 89 return shutdown_type_;
84 } 90 }
85 91
86 void OnShutdownStarting(ShutdownType type) { 92 void OnShutdownStarting(ShutdownType type) {
87 if (shutdown_type_ != NOT_VALID) 93 if (shutdown_type_ != NOT_VALID)
88 return; 94 return;
89 95
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 341
336 bool ShuttingDownWithoutClosingBrowsers() { 342 bool ShuttingDownWithoutClosingBrowsers() {
337 #if defined(USE_X11) 343 #if defined(USE_X11)
338 if (GetShutdownType() == browser_shutdown::END_SESSION) 344 if (GetShutdownType() == browser_shutdown::END_SESSION)
339 return true; 345 return true;
340 #endif 346 #endif
341 return false; 347 return false;
342 } 348 }
343 349
344 } // namespace browser_shutdown 350 } // namespace browser_shutdown
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698