| 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/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 Loading... |
| 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_, ¤t_width, ¤t_height); | 382 gtk_window_get_size(window_, ¤t_width, ¤t_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_, ¤t_width, ¤t_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 Loading... |
| 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 } |
| OLD | NEW |