Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.h" | 5 #import "chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.h" |
| 6 | 6 |
| 7 #include "chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h" | 7 #include "chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h" |
| 8 #import "chrome/browser/ui/views/apps/app_window_native_widget_mac.h" | |
|
tapted
2015/03/18 00:06:39
nit: import->include
jackhou1
2015/03/18 03:44:39
Done.
| |
| 8 | 9 |
| 9 ChromeNativeAppWindowViewsMac::ChromeNativeAppWindowViewsMac() | 10 ChromeNativeAppWindowViewsMac::ChromeNativeAppWindowViewsMac() |
| 10 : is_hidden_with_app_(false) { | 11 : is_hidden_with_app_(false) { |
| 11 } | 12 } |
| 12 | 13 |
| 13 ChromeNativeAppWindowViewsMac::~ChromeNativeAppWindowViewsMac() { | 14 ChromeNativeAppWindowViewsMac::~ChromeNativeAppWindowViewsMac() { |
| 14 } | 15 } |
| 15 | 16 |
| 17 void ChromeNativeAppWindowViewsMac::OnBeforeWidgetInit( | |
| 18 const extensions::AppWindow::CreateParams& create_params, | |
| 19 views::Widget::InitParams* init_params, | |
| 20 views::Widget* widget) { | |
| 21 init_params->native_widget = new AppWindowNativeWidgetMac(widget); | |
|
tapted
2015/03/18 00:06:39
DCHECK(!init_params->native_widget);
i.e. ensure
jackhou1
2015/03/18 03:44:39
Done.
| |
| 22 ChromeNativeAppWindowViews::OnBeforeWidgetInit(create_params, init_params, | |
| 23 widget); | |
| 24 } | |
| 25 | |
| 16 void ChromeNativeAppWindowViewsMac::Show() { | 26 void ChromeNativeAppWindowViewsMac::Show() { |
| 17 if (is_hidden_with_app_) { | 27 if (is_hidden_with_app_) { |
| 18 // If there is a shim to gently request attention, return here. Otherwise | 28 // If there is a shim to gently request attention, return here. Otherwise |
| 19 // show the window as usual. | 29 // show the window as usual. |
| 20 if (apps::ExtensionAppShimHandler::ActivateAndRequestUserAttentionForWindow( | 30 if (apps::ExtensionAppShimHandler::ActivateAndRequestUserAttentionForWindow( |
| 21 app_window())) { | 31 app_window())) { |
| 22 return; | 32 return; |
| 23 } | 33 } |
| 24 } | 34 } |
| 25 | 35 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 36 void ChromeNativeAppWindowViewsMac::ShowWithApp() { | 46 void ChromeNativeAppWindowViewsMac::ShowWithApp() { |
| 37 is_hidden_with_app_ = false; | 47 is_hidden_with_app_ = false; |
| 38 if (!app_window()->is_hidden()) | 48 if (!app_window()->is_hidden()) |
| 39 ShowInactive(); | 49 ShowInactive(); |
| 40 } | 50 } |
| 41 | 51 |
| 42 void ChromeNativeAppWindowViewsMac::HideWithApp() { | 52 void ChromeNativeAppWindowViewsMac::HideWithApp() { |
| 43 is_hidden_with_app_ = true; | 53 is_hidden_with_app_ = true; |
| 44 ChromeNativeAppWindowViews::Hide(); | 54 ChromeNativeAppWindowViews::Hide(); |
| 45 } | 55 } |
| OLD | NEW |