OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.h" |
| 6 |
| 7 #include "chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h" |
| 8 |
| 9 ChromeNativeAppWindowViewsMac::ChromeNativeAppWindowViewsMac() |
| 10 : is_hidden_with_app_(false) { |
| 11 } |
| 12 |
| 13 ChromeNativeAppWindowViewsMac::~ChromeNativeAppWindowViewsMac() { |
| 14 } |
| 15 |
| 16 void ChromeNativeAppWindowViewsMac::Show() { |
| 17 if (is_hidden_with_app_) { |
| 18 // If there is a shim to gently request attention, return here. Otherwise |
| 19 // show the window as usual. |
| 20 if (apps::ExtensionAppShimHandler::ActivateAndRequestUserAttentionForWindow( |
| 21 app_window())) { |
| 22 return; |
| 23 } |
| 24 } |
| 25 |
| 26 ChromeNativeAppWindowViews::Show(); |
| 27 } |
| 28 |
| 29 void ChromeNativeAppWindowViewsMac::ShowInactive() { |
| 30 if (is_hidden_with_app_) |
| 31 return; |
| 32 |
| 33 ChromeNativeAppWindowViews::ShowInactive(); |
| 34 } |
| 35 |
| 36 void ChromeNativeAppWindowViewsMac::ShowWithApp() { |
| 37 is_hidden_with_app_ = false; |
| 38 if (!app_window()->is_hidden()) |
| 39 ShowInactive(); |
| 40 } |
| 41 |
| 42 void ChromeNativeAppWindowViewsMac::HideWithApp() { |
| 43 is_hidden_with_app_ = true; |
| 44 ChromeNativeAppWindowViews::Hide(); |
| 45 } |
OLD | NEW |