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

Side by Side Diff: chrome/browser/debugger/devtools_window.cc

Issue 5915006: Remove user-related data from local_state and add to user_preferences, i... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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 | « no previous file | chrome/browser/net/predictor_api.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) 2010 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_list.h" 10 #include "chrome/browser/browser_list.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 return tab_contents_->render_view_host(); 214 return tab_contents_->render_view_host();
215 } 215 }
216 216
217 void DevToolsWindow::CreateDevToolsBrowser() { 217 void DevToolsWindow::CreateDevToolsBrowser() {
218 // TODO(pfeldman): Make browser's getter for this key static. 218 // TODO(pfeldman): Make browser's getter for this key static.
219 std::string wp_key; 219 std::string wp_key;
220 wp_key.append(prefs::kBrowserWindowPlacement); 220 wp_key.append(prefs::kBrowserWindowPlacement);
221 wp_key.append("_"); 221 wp_key.append("_");
222 wp_key.append(kDevToolsApp); 222 wp_key.append(kDevToolsApp);
223 223
224 PrefService* prefs = g_browser_process->local_state(); 224 PrefService* prefs = profile_->GetPrefs();
225 if (!prefs->FindPreference(wp_key.c_str())) { 225 if (!prefs->FindPreference(wp_key.c_str())) {
226 prefs->RegisterDictionaryPref(wp_key.c_str()); 226 prefs->RegisterDictionaryPref(wp_key.c_str());
227 } 227 }
228 228
229 const DictionaryValue* wp_pref = prefs->GetDictionary(wp_key.c_str()); 229 const DictionaryValue* wp_pref = prefs->GetDictionary(wp_key.c_str());
230 if (!wp_pref) { 230 if (!wp_pref) {
231 DictionaryValue* defaults = prefs->GetMutableDictionary(wp_key.c_str()); 231 DictionaryValue* defaults = prefs->GetMutableDictionary(wp_key.c_str());
232 defaults->SetInteger("left", 100); 232 defaults->SetInteger("left", 100);
233 defaults->SetInteger("top", 100); 233 defaults->SetInteger("top", 100);
234 defaults->SetInteger("right", 740); 234 defaults->SetInteger("right", 740);
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 return false; 427 return false;
428 } 428 }
429 429
430 void DevToolsWindow::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { 430 void DevToolsWindow::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {
431 if (docked_) { 431 if (docked_) {
432 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); 432 BrowserWindow* inspected_window = GetInspectedBrowserWindow();
433 if (inspected_window) 433 if (inspected_window)
434 inspected_window->HandleKeyboardEvent(event); 434 inspected_window->HandleKeyboardEvent(event);
435 } 435 }
436 } 436 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/predictor_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698