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

Unified Diff: chrome/browser/extensions/shell_window_geometry_cache.h

Issue 14031021: Save and restore State for ShellWindows, including panels (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 7 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/extensions/shell_window_geometry_cache.h
diff --git a/chrome/browser/extensions/shell_window_geometry_cache.h b/chrome/browser/extensions/shell_window_geometry_cache.h
index 744077cb2dd3eb3f73d674763d7365de01cd7946..5648b0d4b7b802a8346d7e67330b700bc6856a07 100644
--- a/chrome/browser/extensions/shell_window_geometry_cache.h
+++ b/chrome/browser/extensions/shell_window_geometry_cache.h
@@ -16,6 +16,7 @@
#include "base/values.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "ui/base/ui_base_types.h"
#include "ui/gfx/rect.h"
class Profile;
@@ -36,13 +37,19 @@ class ShellWindowGeometryCache
virtual ~ShellWindowGeometryCache();
+ // Save the geometry and state associated with |extension_id| and |window_id|.
void SaveGeometry(const std::string& extension_id,
const std::string& window_id,
- const gfx::Rect& bounds);
+ const gfx::Rect& bounds,
+ ui::WindowShowState state);
+ // Get any saved geometry and state associated with |extension_id| and
+ // |window_id|. If saved data exists, sets |bounds| and |state| if not NULL
+ // and returns true.
bool GetGeometry(const std::string& extension_id,
const std::string& window_id,
- gfx::Rect* bounds) const;
+ gfx::Rect* bounds,
+ ui::WindowShowState* state) const;
// Maximum number of windows we'll cache the geometry for per app.
static const size_t kMaxCachedWindows = 100;
@@ -58,7 +65,9 @@ class ShellWindowGeometryCache
private:
// Data stored for each window.
struct WindowData {
+ WindowData() : window_state(ui::SHOW_STATE_DEFAULT) {}
gfx::Rect bounds;
+ ui::WindowShowState window_state;
base::Time last_change;
};
« no previous file with comments | « chrome/browser/extensions/platform_app_browsertest.cc ('k') | chrome/browser/extensions/shell_window_geometry_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698