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

Side by Side 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, 9 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 unified diff | Download patch
OLDNEW
(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 }
OLDNEW
« 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