| 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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 gfx::NativeView NativeAppWindowViews::GetHostView() const { | 429 gfx::NativeView NativeAppWindowViews::GetHostView() const { |
| 430 return window_->GetNativeView(); | 430 return window_->GetNativeView(); |
| 431 } | 431 } |
| 432 | 432 |
| 433 gfx::Point NativeAppWindowViews::GetDialogPosition(const gfx::Size& size) { | 433 gfx::Point NativeAppWindowViews::GetDialogPosition(const gfx::Size& size) { |
| 434 gfx::Size shell_window_size = window_->GetWindowBoundsInScreen().size(); | 434 gfx::Size shell_window_size = window_->GetWindowBoundsInScreen().size(); |
| 435 return gfx::Point(shell_window_size.width() / 2 - size.width() / 2, | 435 return gfx::Point(shell_window_size.width() / 2 - size.width() / 2, |
| 436 shell_window_size.height() / 2 - size.height() / 2); | 436 shell_window_size.height() / 2 - size.height() / 2); |
| 437 } | 437 } |
| 438 | 438 |
| 439 gfx::Size NativeAppWindowViews::GetMaximumDialogSize() { |
| 440 return window_->GetWindowBoundsInScreen().size(); |
| 441 } |
| 442 |
| 439 void NativeAppWindowViews::AddObserver( | 443 void NativeAppWindowViews::AddObserver( |
| 440 web_modal::WebContentsModalDialogHostObserver* observer) { | 444 web_modal::WebContentsModalDialogHostObserver* observer) { |
| 441 observer_list_.AddObserver(observer); | 445 observer_list_.AddObserver(observer); |
| 442 } | 446 } |
| 443 void NativeAppWindowViews::RemoveObserver( | 447 void NativeAppWindowViews::RemoveObserver( |
| 444 web_modal::WebContentsModalDialogHostObserver* observer) { | 448 web_modal::WebContentsModalDialogHostObserver* observer) { |
| 445 observer_list_.RemoveObserver(observer); | 449 observer_list_.RemoveObserver(observer); |
| 446 } | 450 } |
| 447 | 451 |
| 448 // Private method. TODO(stevenjb): Move this below InitializePanelWindow() | 452 // Private method. TODO(stevenjb): Move this below InitializePanelWindow() |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 | 773 |
| 770 void NativeAppWindowViews::HandleKeyboardEvent( | 774 void NativeAppWindowViews::HandleKeyboardEvent( |
| 771 const content::NativeWebKeyboardEvent& event) { | 775 const content::NativeWebKeyboardEvent& event) { |
| 772 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, | 776 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, |
| 773 GetFocusManager()); | 777 GetFocusManager()); |
| 774 } | 778 } |
| 775 | 779 |
| 776 void NativeAppWindowViews::RenderViewHostChanged() { | 780 void NativeAppWindowViews::RenderViewHostChanged() { |
| 777 OnViewWasResized(); | 781 OnViewWasResized(); |
| 778 } | 782 } |
| OLD | NEW |