diff options
author | mlamouri@chromium.org <mlamouri@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-29 17:08:18 +0000 |
---|---|---|
committer | mlamouri@chromium.org <mlamouri@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-29 17:08:18 +0000 |
commit | 6349da02900a29e4aab0c7a8a6d308c2326b7247 (patch) | |
tree | 6a68e8c3f6f42c4a07befa56ea4f116d13b51eec /apps/shell_window_geometry_cache.h | |
parent | 74afa629929c8b427f16eb2f7ee73e77234db1cb (diff) | |
download | chromium_src-6349da02900a29e4aab0c7a8a6d308c2326b7247.zip chromium_src-6349da02900a29e4aab0c7a8a6d308c2326b7247.tar.gz chromium_src-6349da02900a29e4aab0c7a8a6d308c2326b7247.tar.bz2 |
Write tests for Maximizing a window through script when non-resizable and
restoring a window position and size after closing it.
BUG=312240
Review URL: https://codereview.chromium.org/64683005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237934 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps/shell_window_geometry_cache.h')
-rw-r--r-- | apps/shell_window_geometry_cache.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/shell_window_geometry_cache.h b/apps/shell_window_geometry_cache.h index b6709df..6af1886 100644 --- a/apps/shell_window_geometry_cache.h +++ b/apps/shell_window_geometry_cache.h @@ -11,6 +11,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" +#include "base/observer_list.h" #include "base/time/time.h" #include "base/timer/timer.h" #include "base/values.h" @@ -57,6 +58,16 @@ class ShellWindowGeometryCache content::BrowserContext* context) const OVERRIDE; }; + class Observer { + public: + virtual void OnGeometryCacheChanged(const std::string& extension_id, + const std::string& window_id, + const gfx::Rect& bounds) = 0; + + protected: + virtual ~Observer() {}; + }; + ShellWindowGeometryCache(Profile* profile, extensions::ExtensionPrefs* prefs); @@ -84,6 +95,9 @@ class ShellWindowGeometryCache // BrowserContextKeyedService virtual void Shutdown() OVERRIDE; + void AddObserver(Observer* observer); + void RemoveObserver(Observer* observer); + // Maximum number of windows we'll cache the geometry for per app. static const size_t kMaxCachedWindows = 100; @@ -134,6 +148,7 @@ class ShellWindowGeometryCache base::TimeDelta sync_delay_; content::NotificationRegistrar registrar_; + ObserverList<Observer> observers_; }; } // namespace apps |