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

Unified Diff: apps/app_shim/extension_app_shim_handler_mac.cc

Issue 461303002: [Mac] Bounce app shims when app windows request attention. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 6 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: apps/app_shim/extension_app_shim_handler_mac.cc
diff --git a/apps/app_shim/extension_app_shim_handler_mac.cc b/apps/app_shim/extension_app_shim_handler_mac.cc
index cef6ca2d3a6c4fdf1c312c177df502224b92aefc..b33585c812510caecae14a13237935d25fdcebb4 100644
--- a/apps/app_shim/extension_app_shim_handler_mac.cc
+++ b/apps/app_shim/extension_app_shim_handler_mac.cc
@@ -267,7 +267,7 @@ void ExtensionAppShimHandler::FocusAppForWindow(AppWindow* app_window) {
}
// static
-bool ExtensionAppShimHandler::RequestUserAttentionForWindow(
+bool ExtensionAppShimHandler::ActivateAndRequestUserAttentionForWindow(
AppWindow* app_window) {
ExtensionAppShimHandler* handler = GetInstance();
Profile* profile = Profile::FromBrowserContext(app_window->browser_context());
@@ -275,7 +275,7 @@ bool ExtensionAppShimHandler::RequestUserAttentionForWindow(
if (host) {
// Bring the window to the front without showing it.
AppWindowRegistry::Get(profile)->AppWindowActivated(app_window);
- host->OnAppRequestUserAttention();
+ host->OnAppRequestUserAttention(APP_SHIM_ATTENTION_INFORMATIONAL);
return true;
} else {
// Just show the app.
@@ -285,6 +285,17 @@ bool ExtensionAppShimHandler::RequestUserAttentionForWindow(
}
// static
+void ExtensionAppShimHandler::RequestUserAttentionForWindow(
+ AppWindow* app_window,
+ AppShimAttentionType attention_type) {
+ ExtensionAppShimHandler* handler = GetInstance();
+ Profile* profile = Profile::FromBrowserContext(app_window->browser_context());
+ Host* host = handler->FindHost(profile, app_window->extension_id());
+ if (host)
+ host->OnAppRequestUserAttention(attention_type);
+}
+
+// static
void ExtensionAppShimHandler::OnChromeWillHide() {
// Send OnAppHide to all the shims so that they go into the hidden state.
// This is necessary so that when the shim is next focused, it will know to

Powered by Google App Engine
This is Rietveld 408576698