| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 gfx::NativeView NativeAppWindowViews::GetHostView() const { | 442 gfx::NativeView NativeAppWindowViews::GetHostView() const { |
| 443 return window_->GetNativeView(); | 443 return window_->GetNativeView(); |
| 444 } | 444 } |
| 445 | 445 |
| 446 gfx::Point NativeAppWindowViews::GetDialogPosition(const gfx::Size& size) { | 446 gfx::Point NativeAppWindowViews::GetDialogPosition(const gfx::Size& size) { |
| 447 gfx::Size shell_window_size = window_->GetWindowBoundsInScreen().size(); | 447 gfx::Size shell_window_size = window_->GetWindowBoundsInScreen().size(); |
| 448 return gfx::Point(shell_window_size.width() / 2 - size.width() / 2, | 448 return gfx::Point(shell_window_size.width() / 2 - size.width() / 2, |
| 449 shell_window_size.height() / 2 - size.height() / 2); | 449 shell_window_size.height() / 2 - size.height() / 2); |
| 450 } | 450 } |
| 451 | 451 |
| 452 gfx::Size NativeAppWindowViews::GetMaximumDialogSize() { |
| 453 return window_->GetWindowBoundsInScreen().size(); |
| 454 } |
| 455 |
| 452 void NativeAppWindowViews::AddObserver( | 456 void NativeAppWindowViews::AddObserver( |
| 453 web_modal::WebContentsModalDialogHostObserver* observer) { | 457 web_modal::WebContentsModalDialogHostObserver* observer) { |
| 454 observer_list_.AddObserver(observer); | 458 observer_list_.AddObserver(observer); |
| 455 } | 459 } |
| 456 void NativeAppWindowViews::RemoveObserver( | 460 void NativeAppWindowViews::RemoveObserver( |
| 457 web_modal::WebContentsModalDialogHostObserver* observer) { | 461 web_modal::WebContentsModalDialogHostObserver* observer) { |
| 458 observer_list_.RemoveObserver(observer); | 462 observer_list_.RemoveObserver(observer); |
| 459 } | 463 } |
| 460 | 464 |
| 461 // Private method. TODO(stevenjb): Move this below InitializePanelWindow() | 465 // Private method. TODO(stevenjb): Move this below InitializePanelWindow() |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 | 786 |
| 783 void NativeAppWindowViews::HandleKeyboardEvent( | 787 void NativeAppWindowViews::HandleKeyboardEvent( |
| 784 const content::NativeWebKeyboardEvent& event) { | 788 const content::NativeWebKeyboardEvent& event) { |
| 785 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, | 789 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, |
| 786 GetFocusManager()); | 790 GetFocusManager()); |
| 787 } | 791 } |
| 788 | 792 |
| 789 void NativeAppWindowViews::RenderViewHostChanged() { | 793 void NativeAppWindowViews::RenderViewHostChanged() { |
| 790 OnViewWasResized(); | 794 OnViewWasResized(); |
| 791 } | 795 } |
| OLD | NEW |