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

Unified Diff: chrome/browser/ui/browser.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, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/cocoa/browser_window_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
===================================================================
--- chrome/browser/ui/browser.cc (revision 73335)
+++ chrome/browser/ui/browser.cc (working copy)
@@ -555,7 +555,7 @@
else
app_name = web_app::GenerateApplicationNameFromURL(url);
- RegisterAppPrefs(app_name);
+ RegisterAppPrefs(app_name, profile);
bool as_panel = extension && (container == extension_misc::LAUNCH_PANEL);
@@ -773,7 +773,7 @@
gfx::Rect restored_bounds = override_bounds_;
bool maximized;
- WindowSizer::GetBrowserWindowBounds(app_name_, restored_bounds, NULL,
+ WindowSizer::GetBrowserWindowBounds(app_name_, restored_bounds, this,
&restored_bounds, &maximized);
return restored_bounds;
}
@@ -792,7 +792,7 @@
// An explicit maximized state was not set. Query the window sizer.
gfx::Rect restored_bounds;
bool maximized = false;
- WindowSizer::GetBrowserWindowBounds(app_name_, restored_bounds, NULL,
+ WindowSizer::GetBrowserWindowBounds(app_name_, restored_bounds, this,
&restored_bounds, &maximized);
return maximized;
}
@@ -2009,11 +2009,10 @@
// 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)
@@ -2062,7 +2061,8 @@
prefs->RegisterBooleanPref(prefs::kDevToolsDisabled, false);
prefs->RegisterBooleanPref(prefs::kIncognitoEnabled, true);
prefs->RegisterDoublePref(prefs::kDefaultZoomLevel, 0.0);
- prefs->RegisterIntegerPref(prefs::kMultipleProfilePrefMigration, 0);
+ prefs->RegisterIntegerPref(prefs::kDevToolsSplitLocation, -1);
+ prefs->RegisterDictionaryPref(prefs::kBrowserWindowPlacement);
// 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);
@@ -3004,7 +3004,7 @@
void Browser::ConvertContentsToApplication(TabContents* contents) {
const GURL& url = contents->controller().GetActiveEntry()->url();
std::string app_name = web_app::GenerateApplicationNameFromURL(url);
- RegisterAppPrefs(app_name);
+ RegisterAppPrefs(app_name, contents->profile());
DetachContents(contents);
Browser* app_browser = Browser::CreateForApp(
@@ -4159,7 +4159,7 @@
}
// static
-void Browser::RegisterAppPrefs(const std::string& app_name) {
+void Browser::RegisterAppPrefs(const std::string& app_name, Profile* profile) {
// A set of apps that we've already started.
static std::set<std::string>* g_app_names = NULL;
@@ -4175,10 +4175,7 @@
std::string window_pref(prefs::kBrowserWindowPlacement);
window_pref.append("_");
window_pref.append(app_name);
- PrefService* prefs = g_browser_process->local_state();
- DCHECK(prefs);
-
- prefs->RegisterDictionaryPref(window_pref.c_str());
+ profile->GetPrefs()->RegisterDictionaryPref(window_pref.c_str());
}
void Browser::TabRestoreServiceChanged(TabRestoreService* service) {
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/cocoa/browser_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698