OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/native_app_window_views.h" | 5 #include "chrome/browser/ui/views/apps/native_app_window_views.h" |
6 | 6 |
7 #include "apps/shell_window.h" | 7 #include "apps/shell_window.h" |
8 #include "apps/ui/views/shell_window_frame_view.h" | 8 #include "apps/ui/views/shell_window_frame_view.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 std::string app_name = | 205 std::string app_name = |
206 web_app::GenerateApplicationNameFromExtensionId(extension()->id()); | 206 web_app::GenerateApplicationNameFromExtensionId(extension()->id()); |
207 | 207 |
208 views::Widget::InitParams init_params(views::Widget::InitParams::TYPE_WINDOW); | 208 views::Widget::InitParams init_params(views::Widget::InitParams::TYPE_WINDOW); |
209 init_params.delegate = this; | 209 init_params.delegate = this; |
210 init_params.remove_standard_frame = ShouldUseChromeStyleFrame(); | 210 init_params.remove_standard_frame = ShouldUseChromeStyleFrame(); |
211 init_params.use_system_default_icon = true; | 211 init_params.use_system_default_icon = true; |
212 // TODO(erg): Conceptually, these are toplevel windows, but we theoretically | 212 // TODO(erg): Conceptually, these are toplevel windows, but we theoretically |
213 // could plumb context through to here in some cases. | 213 // could plumb context through to here in some cases. |
214 init_params.top_level = true; | 214 init_params.top_level = true; |
215 init_params.opacity = create_params.transparent_background | 215 if (create_params.transparent_background) |
216 ? views::Widget::InitParams::TRANSLUCENT_WINDOW | 216 init_params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
217 : views::Widget::InitParams::INFER_OPACITY; | |
218 init_params.keep_on_top = create_params.always_on_top; | 217 init_params.keep_on_top = create_params.always_on_top; |
219 gfx::Rect window_bounds = create_params.bounds; | 218 gfx::Rect window_bounds = create_params.bounds; |
220 bool position_specified = | 219 bool position_specified = |
221 window_bounds.x() != INT_MIN && window_bounds.y() != INT_MIN; | 220 window_bounds.x() != INT_MIN && window_bounds.y() != INT_MIN; |
222 if (position_specified && !window_bounds.IsEmpty()) | 221 if (position_specified && !window_bounds.IsEmpty()) |
223 init_params.bounds = window_bounds; | 222 init_params.bounds = window_bounds; |
224 | 223 |
225 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 224 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
226 // Set up a custom WM_CLASS for app windows. This allows task switchers in | 225 // Set up a custom WM_CLASS for app windows. This allows task switchers in |
227 // X11 environments to distinguish them from main browser windows. | 226 // X11 environments to distinguish them from main browser windows. |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 gfx::Rect client_bounds = gfx::Rect(1000, 1000); | 873 gfx::Rect client_bounds = gfx::Rect(1000, 1000); |
875 gfx::Rect window_bounds = | 874 gfx::Rect window_bounds = |
876 window_->non_client_view()->GetWindowBoundsForClientBounds( | 875 window_->non_client_view()->GetWindowBoundsForClientBounds( |
877 client_bounds); | 876 client_bounds); |
878 return window_bounds.InsetsFrom(client_bounds); | 877 return window_bounds.InsetsFrom(client_bounds); |
879 } | 878 } |
880 | 879 |
881 void NativeAppWindowViews::HideWithApp() {} | 880 void NativeAppWindowViews::HideWithApp() {} |
882 void NativeAppWindowViews::ShowWithApp() {} | 881 void NativeAppWindowViews::ShowWithApp() {} |
883 void NativeAppWindowViews::UpdateWindowMinMaxSize() {} | 882 void NativeAppWindowViews::UpdateWindowMinMaxSize() {} |
OLD | NEW |