Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: chrome/browser/ui/views/apps/native_app_window_views.cc

Issue 22903022: Limit constrained windows to the size of the parent view. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added GetMaximumDialogSize Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698