summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-22 18:38:40 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-22 18:38:40 +0000
commitf006e5759e8e2631b951e0f9e7d696f2f7777728 (patch)
treef32e23ff05d096b4a4f0f20f5693b6f51dc51607
parent830cb6b929f4f6fe2896dddcec421d4f8652be83 (diff)
downloadchromium_src-f006e5759e8e2631b951e0f9e7d696f2f7777728.zip
chromium_src-f006e5759e8e2631b951e0f9e7d696f2f7777728.tar.gz
chromium_src-f006e5759e8e2631b951e0f9e7d696f2f7777728.tar.bz2
Gets the drop arrow to show when dragging URLs over the tab strip.
BUG=none TEST=none Review URL: http://codereview.chromium.org/215047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26839 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/views/tabs/dragged_tab_controller.cc4
-rw-r--r--chrome/browser/views/tabs/tab_strip.cc32
-rw-r--r--chrome/browser/views/tabs/tab_strip.h10
3 files changed, 30 insertions, 16 deletions
diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc
index 7a00715..bd25655 100644
--- a/chrome/browser/views/tabs/dragged_tab_controller.cc
+++ b/chrome/browser/views/tabs/dragged_tab_controller.cc
@@ -29,6 +29,10 @@
#include "views/widget/widget.h"
#include "views/window/window.h"
+#if defined(OS_WIN)
+#include "views/widget/widget_win.h"
+#endif
+
static const int kHorizontalMoveThreshold = 16; // pixels
// Threshold for pinned tabs.
diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc
index cf18449..cfc62a3 100644
--- a/chrome/browser/views/tabs/tab_strip.cc
+++ b/chrome/browser/views/tabs/tab_strip.cc
@@ -11,9 +11,6 @@
#include "app/os_exchange_data.h"
#include "app/resource_bundle.h"
#include "app/slide_animation.h"
-#if defined(OS_WIN)
-#include "app/win_util.h"
-#endif
#include "base/gfx/size.h"
#include "base/stl_util-inl.h"
#include "chrome/browser/browser_theme_provider.h"
@@ -33,6 +30,13 @@
#include "views/window/non_client_view.h"
#include "views/window/window.h"
+#if defined(OS_WIN)
+#include "app/win_util.h"
+#include "views/widget/widget_win.h"
+#elif defined(OS_LINUX)
+#include "views/widget/widget_gtk.h"
+#endif
+
#undef min
#undef max
@@ -1680,7 +1684,8 @@ void TabStrip::SetDropIndex(int index, bool drop_before) {
HWND_TOPMOST, drop_bounds.x(), drop_bounds.y(), drop_bounds.width(),
drop_bounds.height(), SWP_NOACTIVATE | SWP_SHOWWINDOW);
#else
- NOTIMPLEMENTED();
+ drop_info_->arrow_window->SetBounds(drop_bounds);
+ drop_info_->arrow_window->Show();
#endif
}
@@ -1705,29 +1710,30 @@ TabStrip::DropInfo::DropInfo(int drop_index, bool drop_before, bool point_down)
: drop_index(drop_index),
drop_before(drop_before),
point_down(point_down) {
+ arrow_view = new views::ImageView;
+ arrow_view->SetImage(GetDropArrowImage(point_down));
+
#if defined(OS_WIN)
arrow_window = new views::WidgetWin;
+ arrow_window->Init(
+ NULL,
+ gfx::Rect(0, 0, drop_indicator_width, drop_indicator_height));
arrow_window->set_window_style(WS_POPUP);
arrow_window->set_window_ex_style(WS_EX_TOPMOST | WS_EX_NOACTIVATE |
WS_EX_LAYERED | WS_EX_TRANSPARENT);
-
- arrow_view = new views::ImageView;
- arrow_view->SetImage(GetDropArrowImage(point_down));
-
+#else
+ arrow_window = new views::WidgetGtk(views::WidgetGtk::TYPE_POPUP);
+ arrow_window->MakeTransparent();
arrow_window->Init(
NULL,
gfx::Rect(0, 0, drop_indicator_width, drop_indicator_height));
- arrow_window->SetContentsView(arrow_view);
-#else
- NOTIMPLEMENTED();
#endif
+ arrow_window->SetContentsView(arrow_view);
}
TabStrip::DropInfo::~DropInfo() {
// Close eventually deletes the window, which deletes arrow_view too.
-#if defined(OS_WIN)
arrow_window->Close();
-#endif
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/views/tabs/tab_strip.h b/chrome/browser/views/tabs/tab_strip.h
index 34d27d3..44ca864 100644
--- a/chrome/browser/views/tabs/tab_strip.h
+++ b/chrome/browser/views/tabs/tab_strip.h
@@ -12,9 +12,6 @@
#include "chrome/browser/views/tabs/tab_strip_wrapper.h"
#include "views/controls/button/image_button.h"
#include "views/view.h"
-#if defined(OS_WIN)
-#include "views/widget/widget_win.h"
-#endif
class DraggedTabController;
class ScopedMouseCloseWidthCalculator;
@@ -22,6 +19,11 @@ class TabStripModel;
namespace views {
class ImageView;
+#if defined(OS_LINUX)
+class WidgetGtk;
+#elif defined(OS_WIN)
+class WidgetWin;
+#endif
}
///////////////////////////////////////////////////////////////////////////////
@@ -370,6 +372,8 @@ class TabStrip : public views::View,
// TODO(beng): should be views::Widget.
#if defined(OS_WIN)
views::WidgetWin* arrow_window;
+#else
+ views::WidgetGtk* arrow_window;
#endif
views::ImageView* arrow_view;