ExtensionSyncService: listen for relevant changes instead of being explicitly called...
[chromium-blink-merge.git] / chrome / browser / ui / browser_window_state.h
blobb951d386c5aad61de8823180394612c88cc85e31
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_BROWSER_WINDOW_STATE_H_
6 #define CHROME_BROWSER_UI_BROWSER_WINDOW_STATE_H_
8 #include <string>
10 #include "base/memory/scoped_ptr.h"
11 #include "base/prefs/scoped_user_pref_update.h"
12 #include "ui/base/ui_base_types.h"
14 class Browser;
16 namespace base {
17 class DictionaryValue;
20 namespace gfx {
21 class Rect;
24 class PrefService;
26 namespace chrome {
28 std::string GetWindowName(const Browser* browser);
29 // A "window placement dictionary" holds information about the size and location
30 // of the window that is stored in the given PrefService. If the window_name
31 // isn't the name of a registered preference it is assumed to be the name of an
32 // app and the AppWindowPlacement key is used to find the app's dictionary.
33 scoped_ptr<DictionaryPrefUpdate> GetWindowPlacementDictionaryReadWrite(
34 const std::string& window_name,
35 PrefService* prefs);
36 // Returns NULL if the window corresponds to an app that doesn't have placement
37 // information stored in the preferences system.
38 const base::DictionaryValue* GetWindowPlacementDictionaryReadOnly(
39 const std::string& window_name,
40 PrefService* prefs);
42 bool ShouldSaveWindowPlacement(const Browser* browser);
44 void SaveWindowPlacement(const Browser* browser,
45 const gfx::Rect& bounds,
46 ui::WindowShowState show_state);
48 // Return the |bounds| for the browser window to be used upon creation.
49 // The |show_state| variable will receive the desired initial show state for
50 // the window.
51 void GetSavedWindowBoundsAndShowState(const Browser* browser,
52 gfx::Rect* bounds,
53 ui::WindowShowState* show_state);
55 } // namespace chrome
57 #endif // CHROME_BROWSER_UI_BROWSER_WINDOW_STATE_H_