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

Unified Diff: chrome/browser/ui/panels/panel_browser_window_gtk.cc

Issue 9546001: Support detaching/attaching panels via inter-strip drags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/panels/panel_browser_window_gtk.cc
diff --git a/chrome/browser/ui/panels/panel_browser_window_gtk.cc b/chrome/browser/ui/panels/panel_browser_window_gtk.cc
index f84b84fdcff9c8eb8ea2f7d482ee62665782d5e7..e806bf7d08db971adade6146f1c56d944ada6f7f 100644
--- a/chrome/browser/ui/panels/panel_browser_window_gtk.cc
+++ b/chrome/browser/ui/panels/panel_browser_window_gtk.cc
@@ -482,6 +482,10 @@ void PanelBrowserWindowGtk::SetPanelAppIconVisibility(bool visible) {
return;
}
+void PanelBrowserWindowGtk::SetPanelAlwaysOnTop(bool on_top) {
+ gtk_window_set_keep_above(window(), on_top);
+}
+
gfx::Size PanelBrowserWindowGtk::WindowSizeFromContentSize(
const gfx::Size& content_size) const {
gfx::Size frame = GetNonClientFrameSize();
@@ -551,11 +555,11 @@ void PanelBrowserWindowGtk::DidProcessEvent(GdkEvent* event) {
// it here to reduce the reference count.
gtk_target_list_unref(list);
}
- panel_->manager()->StartDragging(panel_.get());
+ panel_->manager()->StartDragging(panel_.get(), gfx::Point(old_x, old_y));
}
if (drag_widget_) {
- panel_->manager()->Drag(new_x - old_x, new_y - old_y);
+ panel_->manager()->Drag(gfx::Point(new_x, new_y));
gdk_event_free(last_mouse_down_);
last_mouse_down_ = gdk_event_copy(event);
}
@@ -777,9 +781,9 @@ class NativePanelTestingGtk : public NativePanelTesting {
private:
virtual void PressLeftMouseButtonTitlebar(
- const gfx::Point& point) OVERRIDE;
+ const gfx::Point& mouse_location) OVERRIDE;
virtual void ReleaseMouseButtonTitlebar() OVERRIDE;
- virtual void DragTitlebar(int delta_x, int delta_y) OVERRIDE;
+ virtual void DragTitlebar(const gfx::Point& mouse_location) OVERRIDE;
virtual void CancelDragTitlebar() OVERRIDE;
virtual void FinishDragTitlebar() OVERRIDE;
virtual bool VerifyDrawingAttention() const OVERRIDE;
@@ -803,7 +807,7 @@ NativePanelTestingGtk::NativePanelTestingGtk(
}
void NativePanelTestingGtk::PressLeftMouseButtonTitlebar(
- const gfx::Point& point) {
+ const gfx::Point& mouse_location) {
// If there is an animation, wait for it to finish as we don't handle button
// clicks while animation is in progress.
while (panel_browser_window_gtk_->IsAnimatingBounds())
@@ -811,8 +815,8 @@ void NativePanelTestingGtk::PressLeftMouseButtonTitlebar(
GdkEvent* event = gdk_event_new(GDK_BUTTON_PRESS);
event->button.button = 1;
- event->button.x_root = point.x();
- event->button.y_root = point.y();
+ event->button.x_root = mouse_location.x();
+ event->button.y_root = mouse_location.y();
panel_browser_window_gtk_->OnTitlebarButtonPressEvent(
panel_browser_window_gtk_->titlebar_widget(),
reinterpret_cast<GdkEventButton*>(event));
@@ -829,15 +833,13 @@ void NativePanelTestingGtk::ReleaseMouseButtonTitlebar() {
MessageLoopForUI::current()->RunAllPending();
}
-void NativePanelTestingGtk::DragTitlebar(int delta_x, int delta_y) {
+void NativePanelTestingGtk::DragTitlebar(const gfx::Point& mouse_location) {
// Prevent extra unwanted signals and focus grabs.
panel_browser_window_gtk_->system_drag_disabled_for_testing_ = true;
GdkEvent* event = gdk_event_new(GDK_MOTION_NOTIFY);
- gdk_event_get_root_coords(panel_browser_window_gtk_->last_mouse_down_,
- &event->motion.x_root, &event->motion.y_root);
- event->motion.x_root += delta_x;
- event->motion.y_root += delta_y;
+ event->motion.x_root = mouse_location.x();
+ event->motion.y_root = mouse_location.y();
panel_browser_window_gtk_->DidProcessEvent(event);
gdk_event_free(event);
MessageLoopForUI::current()->RunAllPending();

Powered by Google App Engine
This is Rietveld 408576698