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

Unified Diff: chrome/browser/ui/extensions/shell_window.h

Issue 10871086: First part of remembering platform app window geometry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
Index: chrome/browser/ui/extensions/shell_window.h
diff --git a/chrome/browser/ui/extensions/shell_window.h b/chrome/browser/ui/extensions/shell_window.h
index b7a137f9e4d677fe726ca915c273894958232760..8ea0ee347f869e15e8c8f3be4279673c0f93f377 100644
--- a/chrome/browser/ui/extensions/shell_window.h
+++ b/chrome/browser/ui/extensions/shell_window.h
@@ -52,8 +52,14 @@ class ShellWindow : public content::NotificationObserver,
// Specify the initial bounds of the window. If empty, the window will be a
// default size.
gfx::Rect bounds;
+ // Specify if bounds should be restored from a previous time
asargent_no_longer_on_chrome 2012/08/28 18:49:41 nit: period at end of sentence
Marijn Kruisselbrink 2012/08/28 22:14:58 Done.
+ bool restorePosition;
+ bool restoreSize;
+
gfx::Size minimum_size;
gfx::Size maximum_size;
+
+ std::string window_key;
};
static ShellWindow* Create(Profile* profile,
@@ -80,6 +86,8 @@ class ShellWindow : public content::NotificationObserver,
// invoke this method instead of using "delete this".
void OnNativeClose();
+ // Save the window position in the prefs.
+ virtual void SaveWindowPosition();
protected:
ShellWindow(Profile* profile,
const extensions::Extension* extension);
@@ -147,10 +155,18 @@ class ShellWindow : public content::NotificationObserver,
virtual void UpdateDraggableRegions(
const std::vector<extensions::DraggableRegion>& regions);
+ // Read window geometry from storage
asargent_no_longer_on_chrome 2012/08/28 18:49:41 nit: period at end of sentence
Marijn Kruisselbrink 2012/08/28 22:14:58 oops, that entire method here is just a leftover f
+ void GeometryFromStorage(bool restorePosition,
+ bool restoreSize,
+ scoped_ptr<base::Value> value);
+
Profile* profile_; // weak pointer - owned by ProfileManager.
// weak pointer - owned by ExtensionService.
const extensions::Extension* extension_;
+ // used for saving/restoring window geometry
asargent_no_longer_on_chrome 2012/08/28 18:49:41 nit: make full sentence, with period at end
Marijn Kruisselbrink 2012/08/28 22:14:58 Done.
+ std::string window_key_;
+
const SessionID session_id_;
scoped_ptr<TabContents> contents_;
// web_contents_ is owned by contents_.

Powered by Google App Engine
This is Rietveld 408576698