| 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/gtk/custom_button.h" | 10 #include "chrome/browser/ui/gtk/custom_button.h" |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 event->motion.y_root = mouse_location.y(); | 631 event->motion.y_root = mouse_location.y(); |
| 632 panel_browser_window_gtk_->drag_helper_->OnMouseMoveEvent( | 632 panel_browser_window_gtk_->drag_helper_->OnMouseMoveEvent( |
| 633 NULL, reinterpret_cast<GdkEventMotion*>(event)); | 633 NULL, reinterpret_cast<GdkEventMotion*>(event)); |
| 634 gdk_event_free(event); | 634 gdk_event_free(event); |
| 635 MessageLoopForUI::current()->RunAllPending(); | 635 MessageLoopForUI::current()->RunAllPending(); |
| 636 } | 636 } |
| 637 | 637 |
| 638 void NativePanelTestingGtk::CancelDragTitlebar() { | 638 void NativePanelTestingGtk::CancelDragTitlebar() { |
| 639 if (!panel_browser_window_gtk_->drag_helper_.get()) | 639 if (!panel_browser_window_gtk_->drag_helper_.get()) |
| 640 return; | 640 return; |
| 641 | 641 panel_browser_window_gtk_->drag_helper_->OnGrabBrokenEvent(NULL, NULL); |
| 642 panel_browser_window_gtk_->drag_helper_->EndDrag(true); | 642 MessageLoopForUI::current()->RunAllPending(); |
| 643 } | 643 } |
| 644 | 644 |
| 645 void NativePanelTestingGtk::FinishDragTitlebar() { | 645 void NativePanelTestingGtk::FinishDragTitlebar() { |
| 646 if (!panel_browser_window_gtk_->drag_helper_.get()) | 646 if (!panel_browser_window_gtk_->drag_helper_.get()) |
| 647 return; | 647 return; |
| 648 | 648 ReleaseMouseButtonTitlebar(panel::NO_MODIFIER); |
| 649 panel_browser_window_gtk_->drag_helper_->EndDrag(false); | |
| 650 } | 649 } |
| 651 | 650 |
| 652 bool NativePanelTestingGtk::VerifyDrawingAttention() const { | 651 bool NativePanelTestingGtk::VerifyDrawingAttention() const { |
| 653 std::string title; | 652 std::string title; |
| 654 BrowserWindowGtk::TitleDecoration decoration = | 653 BrowserWindowGtk::TitleDecoration decoration = |
| 655 panel_browser_window_gtk_->GetWindowTitle(&title); | 654 panel_browser_window_gtk_->GetWindowTitle(&title); |
| 656 return panel_browser_window_gtk_->IsDrawingAttention() && | 655 return panel_browser_window_gtk_->IsDrawingAttention() && |
| 657 decoration == BrowserWindowGtk::PANGO_MARKUP; | 656 decoration == BrowserWindowGtk::PANGO_MARKUP; |
| 658 } | 657 } |
| 659 | 658 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 break; | 690 break; |
| 692 case RESTORE_BUTTON: | 691 case RESTORE_BUTTON: |
| 693 button = titlebar->unminimize_button(); | 692 button = titlebar->unminimize_button(); |
| 694 break; | 693 break; |
| 695 default: | 694 default: |
| 696 NOTREACHED(); | 695 NOTREACHED(); |
| 697 return false; | 696 return false; |
| 698 } | 697 } |
| 699 return gtk_widget_get_visible(button->widget()); | 698 return gtk_widget_get_visible(button->widget()); |
| 700 } | 699 } |
| OLD | NEW |