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

Side by Side Diff: chrome/browser/ui/gtk/apps/native_app_window_gtk.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/gtk/apps/native_app_window_gtk.h" 5 #include "chrome/browser/ui/gtk/apps/native_app_window_gtk.h"
6 6
7 #include <gdk/gdkx.h> 7 #include <gdk/gdkx.h>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/message_loop/message_pump_gtk.h" 10 #include "base/message_loop/message_pump_gtk.h"
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 } 377 }
378 378
379 gfx::Point NativeAppWindowGtk::GetDialogPosition(const gfx::Size& size) { 379 gfx::Point NativeAppWindowGtk::GetDialogPosition(const gfx::Size& size) {
380 gint current_width = 0; 380 gint current_width = 0;
381 gint current_height = 0; 381 gint current_height = 0;
382 gtk_window_get_size(window_, &current_width, &current_height); 382 gtk_window_get_size(window_, &current_width, &current_height);
383 return gfx::Point(current_width / 2 - size.width() / 2, 383 return gfx::Point(current_width / 2 - size.width() / 2,
384 current_height / 2 - size.height() / 2); 384 current_height / 2 - size.height() / 2);
385 } 385 }
386 386
387 gfx::Size NativeAppWindowGtk::GetMaximumDialogSize() {
388 gint current_width = 0;
389 gint current_height = 0;
390 gtk_window_get_size(window_, &current_width, &current_height);
391 return gfx::Size(current_width, current_height);
392 }
393
387 void NativeAppWindowGtk::AddObserver( 394 void NativeAppWindowGtk::AddObserver(
388 web_modal::WebContentsModalDialogHostObserver* observer) { 395 web_modal::WebContentsModalDialogHostObserver* observer) {
389 observer_list_.AddObserver(observer); 396 observer_list_.AddObserver(observer);
390 } 397 }
391 398
392 void NativeAppWindowGtk::RemoveObserver( 399 void NativeAppWindowGtk::RemoveObserver(
393 web_modal::WebContentsModalDialogHostObserver* observer) { 400 web_modal::WebContentsModalDialogHostObserver* observer) {
394 observer_list_.RemoveObserver(observer); 401 observer_list_.RemoveObserver(observer);
395 } 402 }
396 403
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 } 627 }
621 628
622 void NativeAppWindowGtk::UpdateDraggableRegions( 629 void NativeAppWindowGtk::UpdateDraggableRegions(
623 const std::vector<extensions::DraggableRegion>& regions) { 630 const std::vector<extensions::DraggableRegion>& regions) {
624 // Draggable region is not supported for non-frameless window. 631 // Draggable region is not supported for non-frameless window.
625 if (!frameless_) 632 if (!frameless_)
626 return; 633 return;
627 634
628 draggable_region_.reset(ShellWindow::RawDraggableRegionsToSkRegion(regions)); 635 draggable_region_.reset(ShellWindow::RawDraggableRegionsToSkRegion(regions));
629 } 636 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/apps/native_app_window_gtk.h ('k') | chrome/browser/ui/views/apps/native_app_window_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698