OLD | NEW |
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_list.h" | 8 #include "chrome/browser/ui/browser_list.h" |
9 #include "chrome/browser/ui/gtk/browser_titlebar.h" | 9 #include "chrome/browser/ui/gtk/browser_titlebar.h" |
10 #include "chrome/browser/ui/panels/panel.h" | 10 #include "chrome/browser/ui/panels/panel.h" |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 GtkTargetList* list = ui::GetTargetListFromCodeMask(ui::CHROME_TAB); | 493 GtkTargetList* list = ui::GetTargetListFromCodeMask(ui::CHROME_TAB); |
494 gtk_drag_begin(drag_widget_, list, GDK_ACTION_MOVE, 1, last_mouse_down_); | 494 gtk_drag_begin(drag_widget_, list, GDK_ACTION_MOVE, 1, last_mouse_down_); |
495 // gtk_drag_begin increments reference count for GtkTargetList. So unref | 495 // gtk_drag_begin increments reference count for GtkTargetList. So unref |
496 // it here to reduce the reference count. | 496 // it here to reduce the reference count. |
497 gtk_target_list_unref(list); | 497 gtk_target_list_unref(list); |
498 } | 498 } |
499 panel_->manager()->StartDragging(panel_.get()); | 499 panel_->manager()->StartDragging(panel_.get()); |
500 } | 500 } |
501 | 501 |
502 if (drag_widget_) { | 502 if (drag_widget_) { |
503 panel_->manager()->Drag(new_x - old_x); | 503 panel_->manager()->Drag(new_x - old_x, new_y - old_y); |
504 gdk_event_free(last_mouse_down_); | 504 gdk_event_free(last_mouse_down_); |
505 last_mouse_down_ = gdk_event_copy(event); | 505 last_mouse_down_ = gdk_event_copy(event); |
506 } | 506 } |
507 } | 507 } |
508 | 508 |
509 void PanelBrowserWindowGtk::AnimationEnded(const ui::Animation* animation) { | 509 void PanelBrowserWindowGtk::AnimationEnded(const ui::Animation* animation) { |
510 titlebar()->SendEnterNotifyToCloseButtonIfUnderMouse(); | 510 titlebar()->SendEnterNotifyToCloseButtonIfUnderMouse(); |
511 | 511 |
512 content::NotificationService::current()->Notify( | 512 content::NotificationService::current()->Notify( |
513 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, | 513 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 } | 811 } |
812 } | 812 } |
813 | 813 |
814 bool NativePanelTestingGtk::IsWindowSizeKnown() const { | 814 bool NativePanelTestingGtk::IsWindowSizeKnown() const { |
815 return panel_browser_window_gtk_->window_size_known_; | 815 return panel_browser_window_gtk_->window_size_known_; |
816 } | 816 } |
817 | 817 |
818 bool NativePanelTestingGtk::IsAnimatingBounds() const { | 818 bool NativePanelTestingGtk::IsAnimatingBounds() const { |
819 return panel_browser_window_gtk_->IsAnimatingBounds(); | 819 return panel_browser_window_gtk_->IsAnimatingBounds(); |
820 } | 820 } |
OLD | NEW |