OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_win.h" | 5 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_win.h" |
6 | 6 |
7 #include "apps/ui/views/app_window_frame_view.h" | 7 #include "apps/ui/views/app_window_frame_view.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 | 51 |
52 HWND ChromeNativeAppWindowViewsWin::GetNativeAppWindowHWND() const { | 52 HWND ChromeNativeAppWindowViewsWin::GetNativeAppWindowHWND() const { |
53 return views::HWNDForWidget(widget()->GetTopLevelWidget()); | 53 return views::HWNDForWidget(widget()->GetTopLevelWidget()); |
54 } | 54 } |
55 | 55 |
56 bool ChromeNativeAppWindowViewsWin::IsRunningInAsh() { | 56 bool ChromeNativeAppWindowViewsWin::IsRunningInAsh() { |
57 if (!ash::Shell::HasInstance()) | 57 if (!ash::Shell::HasInstance()) |
58 return false; | 58 return false; |
59 | 59 |
60 views::Widget* widget = | 60 views::Widget* widget = GetWidget(); |
61 implicit_cast<views::WidgetDelegate*>(this)->GetWidget(); | |
62 chrome::HostDesktopType host_desktop_type = | 61 chrome::HostDesktopType host_desktop_type = |
63 chrome::GetHostDesktopTypeForNativeWindow(widget->GetNativeWindow()); | 62 chrome::GetHostDesktopTypeForNativeWindow(widget->GetNativeWindow()); |
64 return host_desktop_type == chrome::HOST_DESKTOP_TYPE_ASH; | 63 return host_desktop_type == chrome::HOST_DESKTOP_TYPE_ASH; |
65 } | 64 } |
66 | 65 |
67 void ChromeNativeAppWindowViewsWin::EnsureCaptionStyleSet() { | 66 void ChromeNativeAppWindowViewsWin::EnsureCaptionStyleSet() { |
68 // Windows seems to have issues maximizing windows without WS_CAPTION. | 67 // Windows seems to have issues maximizing windows without WS_CAPTION. |
69 // The default views / Aura implementation will remove this if we are using | 68 // The default views / Aura implementation will remove this if we are using |
70 // frameless or colored windows, so we put it back here. | 69 // frameless or colored windows, so we put it back here. |
71 HWND hwnd = GetNativeAppWindowHWND(); | 70 HWND hwnd = GetNativeAppWindowHWND(); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 ActivateParentDesktopIfNecessary(); | 158 ActivateParentDesktopIfNecessary(); |
160 ChromeNativeAppWindowViewsAura::Activate(); | 159 ChromeNativeAppWindowViewsAura::Activate(); |
161 } | 160 } |
162 | 161 |
163 bool ChromeNativeAppWindowViewsWin::CanMinimize() const { | 162 bool ChromeNativeAppWindowViewsWin::CanMinimize() const { |
164 // Resizing on Windows breaks translucency if the window also has shape. | 163 // Resizing on Windows breaks translucency if the window also has shape. |
165 // See http://crbug.com/417947. | 164 // See http://crbug.com/417947. |
166 return ChromeNativeAppWindowViewsAura::CanMinimize() && | 165 return ChromeNativeAppWindowViewsAura::CanMinimize() && |
167 !(WidgetHasHitTestMask() && is_translucent_); | 166 !(WidgetHasHitTestMask() && is_translucent_); |
168 } | 167 } |
OLD | NEW |