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

Unified Diff: chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm

Issue 461303002: [Mac] Bounce app shims when app windows request attention. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update FakeHost in test. 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: chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
index 72407678984f0e95927ca4bbe1128cb97c1ac7df..6ed2005937edbe882f6f2f8fc6e04412c10b4863 100644
--- a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
@@ -337,8 +337,7 @@ NativeAppWindowCocoa::NativeAppWindowCocoa(
shows_fullscreen_controls_(true),
has_frame_color_(params.has_frame_color),
active_frame_color_(params.active_frame_color),
- inactive_frame_color_(params.inactive_frame_color),
- attention_request_id_(0) {
+ inactive_frame_color_(params.inactive_frame_color) {
Observe(WebContents());
base::scoped_nsobject<NSWindow> window;
@@ -569,7 +568,7 @@ void NativeAppWindowCocoa::Show() {
if (is_hidden_with_app_) {
// If there is a shim to gently request attention, return here. Otherwise
// show the window as usual.
- if (apps::ExtensionAppShimHandler::RequestUserAttentionForWindow(
+ if (apps::ExtensionAppShimHandler::ActivateAndRequestUserAttentionForWindow(
app_window_)) {
return;
}
@@ -728,12 +727,10 @@ void NativeAppWindowCocoa::UpdateDraggableRegionViews() {
}
void NativeAppWindowCocoa::FlashFrame(bool flash) {
- if (flash) {
- attention_request_id_ = [NSApp requestUserAttention:NSInformationalRequest];
- } else {
- [NSApp cancelUserAttentionRequest:attention_request_id_];
- attention_request_id_ = 0;
- }
+ apps::ExtensionAppShimHandler::RequestUserAttentionForWindow(
+ app_window_,
+ flash ? apps::APP_SHIM_ATTENTION_CRITICAL
+ : apps::APP_SHIM_ATTENTION_CANCEL);
}
bool NativeAppWindowCocoa::IsAlwaysOnTop() const {

Powered by Google App Engine
This is Rietveld 408576698