Chromium Code Reviews| Index: chrome/browser/debugger/devtools_window.cc |
| =================================================================== |
| --- chrome/browser/debugger/devtools_window.cc (revision 71191) |
| +++ chrome/browser/debugger/devtools_window.cc (working copy) |
| @@ -17,6 +17,7 @@ |
| #include "chrome/browser/load_notification_details.h" |
| #include "chrome/browser/prefs/pref_service.h" |
| #include "chrome/browser/profiles/profile.h" |
| +#include "chrome/browser/profiles/profile_manager.h" |
| #include "chrome/browser/renderer_host/render_view_host.h" |
| #include "chrome/browser/tab_contents/navigation_controller.h" |
| #include "chrome/browser/tab_contents/navigation_entry.h" |
| @@ -216,20 +217,23 @@ |
| wp_key.append("_"); |
| wp_key.append(kDevToolsApp); |
| - PrefService* prefs = g_browser_process->local_state(); |
| - if (!prefs->FindPreference(wp_key.c_str())) { |
| + ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| + if (profile_manager) { |
| + PrefService* prefs = profile_manager->GetDefaultProfile()->GetPrefs(); |
| prefs->RegisterDictionaryPref(wp_key.c_str()); |
|
apavlov
2011/01/18 00:33:03
I have no relation to this code, but the FindPrefe
|
| - } |
| - const DictionaryValue* wp_pref = prefs->GetDictionary(wp_key.c_str()); |
| - if (!wp_pref) { |
| - DictionaryValue* defaults = prefs->GetMutableDictionary(wp_key.c_str()); |
| - defaults->SetInteger("left", 100); |
| - defaults->SetInteger("top", 100); |
| - defaults->SetInteger("right", 740); |
| - defaults->SetInteger("bottom", 740); |
| - defaults->SetBoolean("maximized", false); |
| - defaults->SetBoolean("always_on_top", false); |
| + const DictionaryValue* wp_pref = prefs->GetDictionary(wp_key.c_str()); |
| + if (!wp_pref) { |
| + DictionaryValue* defaults = prefs->GetMutableDictionary(wp_key.c_str()); |
| + defaults->SetInteger("left", 100); |
| + defaults->SetInteger("top", 100); |
| + defaults->SetInteger("right", 740); |
| + defaults->SetInteger("bottom", 740); |
| + defaults->SetBoolean("maximized", false); |
| + defaults->SetBoolean("always_on_top", false); |
| + } |
| + } else { |
| + NOTREACHED() << "browser process does not have a ProfileManager."; |
| } |
| browser_ = Browser::CreateForDevTools(profile_); |