summaryrefslogtreecommitdiffstats
path: root/extensions/browser/app_window
diff options
context:
space:
mode:
authorlionel.g.landwerlin <lionel.g.landwerlin@intel.com>2015-07-06 14:24:42 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-06 21:25:48 +0000
commit71a2bdcce8a90e91d042e0987812adc5bc451242 (patch)
tree4666ae737f33a32b27b32233e194da68628936bf /extensions/browser/app_window
parentda95173201779658f2bea88fd4c9ef4415575d85 (diff)
downloadchromium_src-71a2bdcce8a90e91d042e0987812adc5bc451242.zip
chromium_src-71a2bdcce8a90e91d042e0987812adc5bc451242.tar.gz
chromium_src-71a2bdcce8a90e91d042e0987812adc5bc451242.tar.bz2
extensions: AppWindowRegistry: add OnAppWindowActivated
Allow the observers to track the last activated application window. BUG=394341 Review URL: https://codereview.chromium.org/1206363007 Cr-Commit-Position: refs/heads/master@{#337478}
Diffstat (limited to 'extensions/browser/app_window')
-rw-r--r--extensions/browser/app_window/app_window_registry.cc4
-rw-r--r--extensions/browser/app_window/app_window_registry.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/extensions/browser/app_window/app_window_registry.cc b/extensions/browser/app_window/app_window_registry.cc
index 7813807..d072499 100644
--- a/extensions/browser/app_window/app_window_registry.cc
+++ b/extensions/browser/app_window/app_window_registry.cc
@@ -64,6 +64,9 @@ void AppWindowRegistry::Observer::OnAppWindowShown(AppWindow* app_window,
bool was_shown) {
}
+void AppWindowRegistry::Observer::OnAppWindowActivated(AppWindow* app_window) {
+}
+
AppWindowRegistry::Observer::~Observer() {
}
@@ -95,6 +98,7 @@ void AppWindowRegistry::AppWindowIconChanged(AppWindow* app_window) {
void AppWindowRegistry::AppWindowActivated(AppWindow* app_window) {
BringToFront(app_window);
+ FOR_EACH_OBSERVER(Observer, observers_, OnAppWindowActivated(app_window));
}
void AppWindowRegistry::AppWindowHidden(AppWindow* app_window) {
diff --git a/extensions/browser/app_window/app_window_registry.h b/extensions/browser/app_window/app_window_registry.h
index 0657720..486a6fc 100644
--- a/extensions/browser/app_window/app_window_registry.h
+++ b/extensions/browser/app_window/app_window_registry.h
@@ -46,6 +46,8 @@ class AppWindowRegistry : public KeyedService {
virtual void OnAppWindowHidden(AppWindow* app_window);
// Called just after a app window was shown.
virtual void OnAppWindowShown(AppWindow* app_window, bool was_hidden);
+ // Called just after a app window was activated.
+ virtual void OnAppWindowActivated(AppWindow* app_window);
protected:
virtual ~Observer();