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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 } | 597 } |
598 } else if (event->button == 2) { | 598 } else if (event->button == 2) { |
599 if (has_hit_titlebar || has_hit_edge) | 599 if (has_hit_titlebar || has_hit_edge) |
600 gdk_window_lower(gdk_window); | 600 gdk_window_lower(gdk_window); |
601 return TRUE; | 601 return TRUE; |
602 } | 602 } |
603 | 603 |
604 return FALSE; | 604 return FALSE; |
605 } | 605 } |
606 | 606 |
| 607 // NativeAppWindow implementation: |
| 608 |
607 void NativeAppWindowGtk::SetFullscreen(bool fullscreen) { | 609 void NativeAppWindowGtk::SetFullscreen(bool fullscreen) { |
608 content_thinks_its_fullscreen_ = fullscreen; | 610 content_thinks_its_fullscreen_ = fullscreen; |
609 if (fullscreen){ | 611 if (fullscreen){ |
610 if (resizable_) { | 612 if (resizable_) { |
611 gtk_window_fullscreen(window_); | 613 gtk_window_fullscreen(window_); |
612 } else { | 614 } else { |
613 // We must first make the window resizable. That won't take effect | 615 // We must first make the window resizable. That won't take effect |
614 // immediately, so OnConfigureDebounced completes the fullscreen call. | 616 // immediately, so OnConfigureDebounced completes the fullscreen call. |
615 gtk_window_set_resizable(window_, TRUE); | 617 gtk_window_set_resizable(window_, TRUE); |
616 } | 618 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 } | 660 } |
659 | 661 |
660 void NativeAppWindowGtk::UpdateDraggableRegions( | 662 void NativeAppWindowGtk::UpdateDraggableRegions( |
661 const std::vector<extensions::DraggableRegion>& regions) { | 663 const std::vector<extensions::DraggableRegion>& regions) { |
662 // Draggable region is not supported for non-frameless window. | 664 // Draggable region is not supported for non-frameless window. |
663 if (!frameless_) | 665 if (!frameless_) |
664 return; | 666 return; |
665 | 667 |
666 draggable_region_.reset(ShellWindow::RawDraggableRegionsToSkRegion(regions)); | 668 draggable_region_.reset(ShellWindow::RawDraggableRegionsToSkRegion(regions)); |
667 } | 669 } |
| 670 |
| 671 SkRegion* NativeAppWindowGtk::GetDraggableRegion() { |
| 672 return draggable_region_.get(); |
| 673 } |
| 674 |
| 675 bool NativeAppWindowGtk::IsFrameless() const { |
| 676 return frameless_; |
| 677 } |
OLD | NEW |