summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/browser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/browser.cc')
-rw-r--r--chrome/browser/ui/browser.cc21
1 files changed, 12 insertions, 9 deletions
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 81fb6db..54f8677 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -543,7 +543,7 @@ TabContents* Browser::OpenApplicationWindow(
else
app_name = web_app::GenerateApplicationNameFromURL(url);
- RegisterAppPrefs(app_name, profile);
+ RegisterAppPrefs(app_name);
bool as_panel = extension && (container == extension_misc::LAUNCH_PANEL);
@@ -739,7 +739,7 @@ gfx::Rect Browser::GetSavedWindowBounds() const {
gfx::Rect restored_bounds = override_bounds_;
bool maximized;
- WindowSizer::GetBrowserWindowBounds(app_name_, restored_bounds, this,
+ WindowSizer::GetBrowserWindowBounds(app_name_, restored_bounds, NULL,
&restored_bounds, &maximized);
return restored_bounds;
}
@@ -758,7 +758,7 @@ bool Browser::GetSavedMaximizedState() const {
// An explicit maximized state was not set. Query the window sizer.
gfx::Rect restored_bounds;
bool maximized = false;
- WindowSizer::GetBrowserWindowBounds(app_name_, restored_bounds, this,
+ WindowSizer::GetBrowserWindowBounds(app_name_, restored_bounds, NULL,
&restored_bounds, &maximized);
return maximized;
}
@@ -1974,10 +1974,11 @@ void Browser::SetNewHomePagePrefs(PrefService* prefs) {
// static
void Browser::RegisterPrefs(PrefService* prefs) {
+ prefs->RegisterDictionaryPref(prefs::kBrowserWindowPlacement);
prefs->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0);
+ prefs->RegisterIntegerPref(prefs::kDevToolsSplitLocation, -1);
prefs->RegisterDictionaryPref(prefs::kPreferencesWindowPlacement);
prefs->RegisterIntegerPref(prefs::kExtensionSidebarWidth, -1);
- prefs->RegisterIntegerPref(prefs::kMultipleProfilePrefMigration, 0);
// Educated guess: Chrome has a bundled Flash version supporting
// clearing LSO data, Chromium hasn't.
#if defined(GOOGLE_CHROME_BUILD)
@@ -2025,8 +2026,7 @@ void Browser::RegisterUserPrefs(PrefService* prefs) {
prefs->RegisterStringPref(prefs::kCloudPrintEmail, std::string());
prefs->RegisterBooleanPref(prefs::kDevToolsDisabled, false);
prefs->RegisterRealPref(prefs::kDefaultZoomLevel, 0.0);
- prefs->RegisterIntegerPref(prefs::kDevToolsSplitLocation, -1);
- prefs->RegisterDictionaryPref(prefs::kBrowserWindowPlacement);
+ prefs->RegisterIntegerPref(prefs::kMultipleProfilePrefMigration, 0);
// We need to register the type of this preference in order to query
// it even though it's only typically controlled via policy.
prefs->RegisterBooleanPref(prefs::kDisable3DAPIs, false);
@@ -2964,7 +2964,7 @@ bool Browser::IsApplication() const {
void Browser::ConvertContentsToApplication(TabContents* contents) {
const GURL& url = contents->controller().GetActiveEntry()->url();
std::string app_name = web_app::GenerateApplicationNameFromURL(url);
- RegisterAppPrefs(app_name, contents->profile());
+ RegisterAppPrefs(app_name);
DetachContents(contents);
Browser* app_browser = Browser::CreateForApp(
@@ -4118,7 +4118,7 @@ void Browser::TabDetachedAtImpl(TabContentsWrapper* contents, int index,
}
// static
-void Browser::RegisterAppPrefs(const std::string& app_name, Profile* profile) {
+void Browser::RegisterAppPrefs(const std::string& app_name) {
// A set of apps that we've already started.
static std::set<std::string>* g_app_names = NULL;
@@ -4134,7 +4134,10 @@ void Browser::RegisterAppPrefs(const std::string& app_name, Profile* profile) {
std::string window_pref(prefs::kBrowserWindowPlacement);
window_pref.append("_");
window_pref.append(app_name);
- profile->GetPrefs()->RegisterDictionaryPref(window_pref.c_str());
+ PrefService* prefs = g_browser_process->local_state();
+ DCHECK(prefs);
+
+ prefs->RegisterDictionaryPref(window_pref.c_str());
}
void Browser::TabRestoreServiceChanged(TabRestoreService* service) {