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

Side by Side Diff: chrome/browser/ui/panels/panel_browser_window_gtk.cc

Issue 10834205: Draggable region support for frameless app window on GTK. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
« no previous file with comments | « chrome/browser/ui/panels/panel_browser_window_gtk.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/panels/panel_browser_window_gtk.h" 5 #include "chrome/browser/ui/panels/panel_browser_window_gtk.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_list.h" 9 #include "chrome/browser/ui/browser_list.h"
10 #include "chrome/browser/ui/browser_window.h" 10 #include "chrome/browser/ui/browser_window.h"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 void PanelBrowserWindowGtk::EnsureDragHelperCreated() { 253 void PanelBrowserWindowGtk::EnsureDragHelperCreated() {
254 if (drag_helper_.get()) 254 if (drag_helper_.get())
255 return; 255 return;
256 256
257 drag_helper_.reset(new PanelDragGtk(panel_.get())); 257 drag_helper_.reset(new PanelDragGtk(panel_.get()));
258 gtk_box_pack_end(GTK_BOX(window_vbox_), drag_helper_->widget(), 258 gtk_box_pack_end(GTK_BOX(window_vbox_), drag_helper_->widget(),
259 FALSE, FALSE, 0); 259 FALSE, FALSE, 0);
260 } 260 }
261 261
262 bool PanelBrowserWindowGtk::HandleTitleBarLeftMousePress( 262 bool PanelBrowserWindowGtk::HandleTitleBarLeftMousePress(
263 GdkEventButton* event, 263 GdkEventButton* event) {
264 guint32 last_click_time,
265 gfx::Point last_click_position) {
266 DCHECK_EQ(1U, event->button); 264 DCHECK_EQ(1U, event->button);
267 DCHECK_EQ(GDK_BUTTON_PRESS, event->type); 265 DCHECK_EQ(GDK_BUTTON_PRESS, event->type);
268 266
269 EnsureDragHelperCreated(); 267 EnsureDragHelperCreated();
270 drag_helper_->InitialTitlebarMousePress(event, titlebar_widget()); 268 drag_helper_->InitialTitlebarMousePress(event, titlebar_widget());
271 return TRUE; 269 return TRUE;
272 } 270 }
273 271
274 bool PanelBrowserWindowGtk::HandleWindowEdgeLeftMousePress( 272 bool PanelBrowserWindowGtk::HandleWindowEdgeLeftMousePress(
275 GtkWindow* window, 273 GtkWindow* window,
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 while (panel_browser_window_gtk_->IsAnimatingBounds()) 664 while (panel_browser_window_gtk_->IsAnimatingBounds())
667 MessageLoopForUI::current()->RunAllPending(); 665 MessageLoopForUI::current()->RunAllPending();
668 666
669 GdkEvent* event = gdk_event_new(GDK_BUTTON_PRESS); 667 GdkEvent* event = gdk_event_new(GDK_BUTTON_PRESS);
670 event->button.button = 1; 668 event->button.button = 1;
671 event->button.x_root = mouse_location.x(); 669 event->button.x_root = mouse_location.x();
672 event->button.y_root = mouse_location.y(); 670 event->button.y_root = mouse_location.y();
673 if (modifier == panel::APPLY_TO_ALL) 671 if (modifier == panel::APPLY_TO_ALL)
674 event->button.state |= GDK_CONTROL_MASK; 672 event->button.state |= GDK_CONTROL_MASK;
675 panel_browser_window_gtk_->HandleTitleBarLeftMousePress( 673 panel_browser_window_gtk_->HandleTitleBarLeftMousePress(
676 reinterpret_cast<GdkEventButton*>(event), 674 reinterpret_cast<GdkEventButton*>(event));
677 GDK_CURRENT_TIME, gfx::Point());
678 gdk_event_free(event); 675 gdk_event_free(event);
679 MessageLoopForUI::current()->RunAllPending(); 676 MessageLoopForUI::current()->RunAllPending();
680 } 677 }
681 678
682 void NativePanelTestingGtk::ReleaseMouseButtonTitlebar( 679 void NativePanelTestingGtk::ReleaseMouseButtonTitlebar(
683 panel::ClickModifier modifier) { 680 panel::ClickModifier modifier) {
684 GdkEvent* event = gdk_event_new(GDK_BUTTON_RELEASE); 681 GdkEvent* event = gdk_event_new(GDK_BUTTON_RELEASE);
685 event->button.button = 1; 682 event->button.button = 1;
686 if (modifier == panel::APPLY_TO_ALL) 683 if (modifier == panel::APPLY_TO_ALL)
687 event->button.state |= GDK_CONTROL_MASK; 684 event->button.state |= GDK_CONTROL_MASK;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 break; 756 break;
760 case panel::RESTORE_BUTTON: 757 case panel::RESTORE_BUTTON:
761 button = titlebar->restore_button(); 758 button = titlebar->restore_button();
762 break; 759 break;
763 default: 760 default:
764 NOTREACHED(); 761 NOTREACHED();
765 return false; 762 return false;
766 } 763 }
767 return gtk_widget_get_visible(button->widget()); 764 return gtk_widget_get_visible(button->widget());
768 } 765 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/panel_browser_window_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698