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/ui/views/shell_window_frame_view.h" | 7 #include "apps/ui/views/shell_window_frame_view.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 #if defined(USE_ASH) | 42 #if defined(USE_ASH) |
43 #include "ash/ash_constants.h" | 43 #include "ash/ash_constants.h" |
44 #include "ash/screen_ash.h" | 44 #include "ash/screen_ash.h" |
45 #include "ash/shell.h" | 45 #include "ash/shell.h" |
46 #include "ash/wm/custom_frame_view_ash.h" | 46 #include "ash/wm/custom_frame_view_ash.h" |
47 #include "ash/wm/panels/panel_frame_view.h" | 47 #include "ash/wm/panels/panel_frame_view.h" |
48 #include "ash/wm/window_state.h" | 48 #include "ash/wm/window_state.h" |
49 #include "chrome/browser/ui/ash/ash_util.h" | 49 #include "chrome/browser/ui/ash/ash_util.h" |
50 #include "ui/aura/client/aura_constants.h" | 50 #include "ui/aura/client/aura_constants.h" |
| 51 #include "ui/aura/client/window_tree_client.h" |
51 #include "ui/aura/root_window.h" | 52 #include "ui/aura/root_window.h" |
52 #include "ui/aura/window.h" | 53 #include "ui/aura/window.h" |
53 #endif | 54 #endif |
54 | 55 |
55 using apps::ShellWindow; | 56 using apps::ShellWindow; |
56 | 57 |
57 namespace { | 58 namespace { |
58 | 59 |
59 const int kMinPanelWidth = 100; | 60 const int kMinPanelWidth = 100; |
60 const int kMinPanelHeight = 100; | 61 const int kMinPanelHeight = 100; |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 window_->set_focus_on_creation(create_params.focused); | 283 window_->set_focus_on_creation(create_params.focused); |
283 | 284 |
284 #if defined(USE_ASH) | 285 #if defined(USE_ASH) |
285 if (create_params.state == ui::SHOW_STATE_DETACHED) { | 286 if (create_params.state == ui::SHOW_STATE_DETACHED) { |
286 gfx::Rect window_bounds(create_params.bounds.x(), | 287 gfx::Rect window_bounds(create_params.bounds.x(), |
287 create_params.bounds.y(), | 288 create_params.bounds.y(), |
288 preferred_size_.width(), | 289 preferred_size_.width(), |
289 preferred_size_.height()); | 290 preferred_size_.height()); |
290 aura::Window* native_window = GetNativeWindow(); | 291 aura::Window* native_window = GetNativeWindow(); |
291 ash::wm::GetWindowState(native_window)->set_panel_attached(false); | 292 ash::wm::GetWindowState(native_window)->set_panel_attached(false); |
292 native_window->SetDefaultParentByRootWindow( | 293 aura::client::ParentWindowWithContext(native_window, |
293 native_window->GetRootWindow(), native_window->GetBoundsInScreen()); | 294 native_window->GetRootWindow(), |
| 295 native_window->GetBoundsInScreen()); |
294 window_->SetBounds(window_bounds); | 296 window_->SetBounds(window_bounds); |
295 } | 297 } |
296 #else | 298 #else |
297 // TODO(stevenjb): NativeAppWindow panels need to be implemented for other | 299 // TODO(stevenjb): NativeAppWindow panels need to be implemented for other |
298 // platforms. | 300 // platforms. |
299 #endif | 301 #endif |
300 } | 302 } |
301 | 303 |
302 bool NativeAppWindowViews::ShouldUseChromeStyleFrame() const { | 304 bool NativeAppWindowViews::ShouldUseChromeStyleFrame() const { |
303 return !CommandLine::ForCurrentProcess()->HasSwitch( | 305 return !CommandLine::ForCurrentProcess()->HasSwitch( |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 client_bounds); | 831 client_bounds); |
830 return window_bounds.InsetsFrom(client_bounds); | 832 return window_bounds.InsetsFrom(client_bounds); |
831 } | 833 } |
832 | 834 |
833 bool NativeAppWindowViews::IsVisible() const { | 835 bool NativeAppWindowViews::IsVisible() const { |
834 return window_->IsVisible(); | 836 return window_->IsVisible(); |
835 } | 837 } |
836 | 838 |
837 void NativeAppWindowViews::HideWithApp() {} | 839 void NativeAppWindowViews::HideWithApp() {} |
838 void NativeAppWindowViews::ShowWithApp() {} | 840 void NativeAppWindowViews::ShowWithApp() {} |
OLD | NEW |