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

Unified Diff: apps/app_shim/chrome_main_app_mode_mac.mm

Issue 461303002: [Mac] Bounce app shims when app windows request attention. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/chrome_main_app_mode_mac.mm
diff --git a/apps/app_shim/chrome_main_app_mode_mac.mm b/apps/app_shim/chrome_main_app_mode_mac.mm
index 18b8f9e1cfdbca32b371e69ba850be1f2bc33587..ad92a736cad8bb300a9558d8b2c685622d9cd821 100644
--- a/apps/app_shim/chrome_main_app_mode_mac.mm
+++ b/apps/app_shim/chrome_main_app_mode_mac.mm
@@ -130,7 +130,7 @@ class AppShimController : public IPC::Listener {
void OnHide();
// Requests user attention.
- void OnRequestUserAttention();
+ void OnRequestUserAttention(apps::AppShimAttentionType attention_type);
// Terminates the app shim process.
void Close();
@@ -140,6 +140,7 @@ class AppShimController : public IPC::Listener {
base::scoped_nsobject<AppShimDelegate> delegate_;
bool launch_app_done_;
bool ping_chrome_reply_received_;
+ NSInteger attention_request_id_;
DISALLOW_COPY_AND_ASSIGN(AppShimController);
};
@@ -309,8 +310,22 @@ void AppShimController::OnHide() {
[NSApp hide:nil];
}
-void AppShimController::OnRequestUserAttention() {
- [NSApp requestUserAttention:NSInformationalRequest];
+void AppShimController::OnRequestUserAttention(
+ apps::AppShimAttentionType attention_type) {
+ switch (attention_type) {
+ case apps::APP_SHIM_ATTENTION_CANCEL:
+ [NSApp cancelUserAttentionRequest:attention_request_id_];
+ attention_request_id_ = 0;
+ break;
+ case apps::APP_SHIM_ATTENTION_CRITICAL:
+ attention_request_id_ = [NSApp requestUserAttention:NSCriticalRequest];
+ break;
+ case apps::APP_SHIM_ATTENTION_INFORMATIONAL:
+ attention_request_id_ =
+ [NSApp requestUserAttention:NSInformationalRequest];
+ default:
+ break;
tapted 2014/08/13 03:37:08 maybe case apps::APP_SHIM_ATTENTION_NUM_TYPES:
jackhou1 2014/08/13 05:53:45 Done.
+ }
}
void AppShimController::Close() {

Powered by Google App Engine
This is Rietveld 408576698