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

Unified Diff: chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.mm

Issue 975043003: [MacViews] Add NativeAppWindowViewsMac and port HideWithApp behavior from NativeAppWindowCocoa. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@views
Patch Set: Change gypi variable name. Created 5 years, 10 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
« no previous file with comments | « chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
+}
« no previous file with comments | « chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698