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

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: No initializer Created 7 years, 3 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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/apps/native_app_window_views.h ('k') | chrome/browser/ui/views/constrained_window_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698