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