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

Side by Side Diff: chrome/browser/debugger/devtools_window.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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/json/json_writer.h" 6 #include "base/json/json_writer.h"
7 #include "base/string_number_conversions.h" 7 #include "base/string_number_conversions.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 218
219 void DevToolsWindow::CreateDevToolsBrowser() { 219 void DevToolsWindow::CreateDevToolsBrowser() {
220 // TODO(pfeldman): Make browser's getter for this key static. 220 // TODO(pfeldman): Make browser's getter for this key static.
221 std::string wp_key; 221 std::string wp_key;
222 wp_key.append(prefs::kBrowserWindowPlacement); 222 wp_key.append(prefs::kBrowserWindowPlacement);
223 wp_key.append("_"); 223 wp_key.append("_");
224 wp_key.append(kDevToolsApp); 224 wp_key.append(kDevToolsApp);
225 225
226 PrefService* prefs = profile_->GetPrefs(); 226 PrefService* prefs = profile_->GetPrefs();
227 if (!prefs->FindPreference(wp_key.c_str())) { 227 if (!prefs->FindPreference(wp_key.c_str())) {
228 prefs->RegisterDictionaryPref(wp_key.c_str()); 228 prefs->RegisterDictionaryPref(wp_key.c_str(), false /* don't sync pref */);
229 } 229 }
230 230
231 const DictionaryValue* wp_pref = prefs->GetDictionary(wp_key.c_str()); 231 const DictionaryValue* wp_pref = prefs->GetDictionary(wp_key.c_str());
232 if (!wp_pref || wp_pref->empty()) { 232 if (!wp_pref || wp_pref->empty()) {
233 DictionaryPrefUpdate update(prefs, wp_key.c_str()); 233 DictionaryPrefUpdate update(prefs, wp_key.c_str());
234 DictionaryValue* defaults = update.Get(); 234 DictionaryValue* defaults = update.Get();
235 defaults->SetInteger("left", 100); 235 defaults->SetInteger("left", 100);
236 defaults->SetInteger("top", 100); 236 defaults->SetInteger("top", 100);
237 defaults->SetInteger("right", 740); 237 defaults->SetInteger("right", 740);
238 defaults->SetInteger("bottom", 740); 238 defaults->SetInteger("bottom", 740);
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 if (docked_) { 454 if (docked_) {
455 if (event.windowsKeyCode == 0x08) { 455 if (event.windowsKeyCode == 0x08) {
456 // Do not navigate back in history on Windows (http://crbug.com/74156). 456 // Do not navigate back in history on Windows (http://crbug.com/74156).
457 return; 457 return;
458 } 458 }
459 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); 459 BrowserWindow* inspected_window = GetInspectedBrowserWindow();
460 if (inspected_window) 460 if (inspected_window)
461 inspected_window->HandleKeyboardEvent(event); 461 inspected_window->HandleKeyboardEvent(event);
462 } 462 }
463 } 463 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698