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

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: Really fix. And rebase 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
« no previous file with comments | « chrome/browser/debugger/devtools_manager.cc ('k') | chrome/browser/download/download_prefs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 void DevToolsWindow::CreateDevToolsBrowser() { 220 void DevToolsWindow::CreateDevToolsBrowser() {
221 // TODO(pfeldman): Make browser's getter for this key static. 221 // TODO(pfeldman): Make browser's getter for this key static.
222 std::string wp_key; 222 std::string wp_key;
223 wp_key.append(prefs::kBrowserWindowPlacement); 223 wp_key.append(prefs::kBrowserWindowPlacement);
224 wp_key.append("_"); 224 wp_key.append("_");
225 wp_key.append(kDevToolsApp); 225 wp_key.append(kDevToolsApp);
226 226
227 PrefService* prefs = profile_->GetPrefs(); 227 PrefService* prefs = profile_->GetPrefs();
228 if (!prefs->FindPreference(wp_key.c_str())) { 228 if (!prefs->FindPreference(wp_key.c_str())) {
229 prefs->RegisterDictionaryPref(wp_key.c_str()); 229 prefs->RegisterDictionaryPref(wp_key.c_str(), PrefService::UNSYNCABLE_PREF);
230 } 230 }
231 231
232 const DictionaryValue* wp_pref = prefs->GetDictionary(wp_key.c_str()); 232 const DictionaryValue* wp_pref = prefs->GetDictionary(wp_key.c_str());
233 if (!wp_pref || wp_pref->empty()) { 233 if (!wp_pref || wp_pref->empty()) {
234 DictionaryPrefUpdate update(prefs, wp_key.c_str()); 234 DictionaryPrefUpdate update(prefs, wp_key.c_str());
235 DictionaryValue* defaults = update.Get(); 235 DictionaryValue* defaults = update.Get();
236 defaults->SetInteger("left", 100); 236 defaults->SetInteger("left", 100);
237 defaults->SetInteger("top", 100); 237 defaults->SetInteger("top", 100);
238 defaults->SetInteger("right", 740); 238 defaults->SetInteger("right", 740);
239 defaults->SetInteger("bottom", 740); 239 defaults->SetInteger("bottom", 740);
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 if (docked_) { 455 if (docked_) {
456 if (event.windowsKeyCode == 0x08) { 456 if (event.windowsKeyCode == 0x08) {
457 // Do not navigate back in history on Windows (http://crbug.com/74156). 457 // Do not navigate back in history on Windows (http://crbug.com/74156).
458 return; 458 return;
459 } 459 }
460 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); 460 BrowserWindow* inspected_window = GetInspectedBrowserWindow();
461 if (inspected_window) 461 if (inspected_window)
462 inspected_window->HandleKeyboardEvent(event); 462 inspected_window->HandleKeyboardEvent(event);
463 } 463 }
464 } 464 }
OLDNEW
« no previous file with comments | « chrome/browser/debugger/devtools_manager.cc ('k') | chrome/browser/download/download_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698