Index: chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.mm |
diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.mm b/chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4920ac74158f2413895398431c6941d2fa0f5a15 |
--- /dev/null |
+++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.mm |
@@ -0,0 +1,45 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#import "chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.h" |
+ |
+#include "chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h" |
+ |
+ChromeNativeAppWindowViewsMac::ChromeNativeAppWindowViewsMac() |
+ : is_hidden_with_app_(false) { |
+} |
+ |
+ChromeNativeAppWindowViewsMac::~ChromeNativeAppWindowViewsMac() { |
+} |
+ |
+void ChromeNativeAppWindowViewsMac::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::ActivateAndRequestUserAttentionForWindow( |
+ app_window())) { |
+ return; |
+ } |
+ } |
+ |
+ ChromeNativeAppWindowViews::Show(); |
+} |
+ |
+void ChromeNativeAppWindowViewsMac::ShowInactive() { |
+ if (is_hidden_with_app_) |
+ return; |
+ |
+ ChromeNativeAppWindowViews::ShowInactive(); |
+} |
+ |
+void ChromeNativeAppWindowViewsMac::ShowWithApp() { |
+ is_hidden_with_app_ = false; |
+ if (!app_window()->is_hidden()) |
+ ShowInactive(); |
+} |
+ |
+void ChromeNativeAppWindowViewsMac::HideWithApp() { |
+ is_hidden_with_app_ = true; |
+ ChromeNativeAppWindowViews::Hide(); |
+} |