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

Unified Diff: chrome/browser/ui/window_sizer.cc

Issue 6247017: Revert 72153 - Remove user-related data from local_state and add to user_pre... (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/window_sizer.h ('k') | chrome/common/pref_names.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/window_sizer.cc
===================================================================
--- chrome/browser/ui/window_sizer.cc (revision 72174)
+++ chrome/browser/ui/window_sizer.cc (working copy)
@@ -6,7 +6,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
@@ -17,9 +16,9 @@
// and persistent state from the browser window and the user's profile.
class DefaultStateProvider : public WindowSizer::StateProvider {
public:
- explicit DefaultStateProvider(const std::string& app_name,
- const Browser* browser) : app_name_(app_name),
- browser_(browser) {
+ explicit DefaultStateProvider(const std::string& app_name, Browser* browser)
+ : app_name_(app_name),
+ browser_(browser) {
}
// Overridden from WindowSizer::StateProvider:
@@ -34,11 +33,11 @@
key.append(app_name_);
}
- if (!browser_->profile()->GetPrefs())
+ if (!g_browser_process->local_state())
return false;
const DictionaryValue* wp_pref =
- browser_->profile()->GetPrefs()->GetDictionary(key.c_str());
+ g_browser_process->local_state()->GetDictionary(key.c_str());
int top = 0, left = 0, bottom = 0, right = 0;
bool has_prefs =
wp_pref &&
@@ -75,9 +74,9 @@
// If a reference browser is set, use its window. Otherwise find last
// active.
BrowserWindow* window = NULL;
- // Window may be null if browser is just starting up.
- if (browser_ && browser_->window()) {
+ if (browser_) {
window = browser_->window();
+ DCHECK(window);
} else {
BrowserList::const_reverse_iterator it = BrowserList::begin_last_active();
BrowserList::const_reverse_iterator end = BrowserList::end_last_active();
@@ -103,7 +102,7 @@
std::string app_name_;
// If set, is used as the reference browser for GetLastActiveWindowState.
- const Browser* browser_;
+ Browser* browser_;
DISALLOW_COPY_AND_ASSIGN(DefaultStateProvider);
};
@@ -133,7 +132,7 @@
// static
void WindowSizer::GetBrowserWindowBounds(const std::string& app_name,
const gfx::Rect& specified_bounds,
- const Browser* browser,
+ Browser* browser,
gfx::Rect* window_bounds,
bool* maximized) {
const WindowSizer sizer(new DefaultStateProvider(app_name, browser),
Property changes on: chrome/browser/ui/window_sizer.cc
___________________________________________________________________
Added: svn:mergeinfo
« no previous file with comments | « chrome/browser/ui/window_sizer.h ('k') | chrome/common/pref_names.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698