Commit 599cf87a authored by brettw@chromium.org's avatar brettw@chromium.org

Fix the Views-GTK build by adding necessary tab_strip_2 files and fixing some compilation errors.

Review URL: http://codereview.chromium.org/155184

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20153 0039d316-1c4b-4281-b951-d872f2087c98
parent bf5c2ff3
...@@ -59,6 +59,10 @@ void BrowserFrameGtk::UpdateThrobber(bool running) { ...@@ -59,6 +59,10 @@ void BrowserFrameGtk::UpdateThrobber(bool running) {
browser_frame_view_->UpdateThrobber(running); browser_frame_view_->UpdateThrobber(running);
} }
void BrowserFrameGtk::ContinueDraggingDetachedTab() {
NOTIMPLEMENTED();
}
ThemeProvider* BrowserFrameGtk::GetThemeProviderForFrame() const { ThemeProvider* BrowserFrameGtk::GetThemeProviderForFrame() const {
// This is implemented for a different interface than GetThemeProvider is, // This is implemented for a different interface than GetThemeProvider is,
// but they mean the same things. // but they mean the same things.
......
...@@ -30,6 +30,7 @@ class BrowserFrameGtk : public BrowserFrame, ...@@ -30,6 +30,7 @@ class BrowserFrameGtk : public BrowserFrame,
virtual int GetMinimizeButtonOffset() const; virtual int GetMinimizeButtonOffset() const;
virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const; virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const;
virtual void UpdateThrobber(bool running); virtual void UpdateThrobber(bool running);
virtual void ContinueDraggingDetachedTab();
virtual ThemeProvider* GetThemeProviderForFrame() const; virtual ThemeProvider* GetThemeProviderForFrame() const;
// Overridden from views::Widget. // Overridden from views::Widget.
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "app/gfx/canvas.h" #include "app/gfx/canvas.h"
#include "app/gfx/font.h" #include "app/gfx/font.h"
#include "app/gfx/path.h" #include "app/gfx/path.h"
#include "base/string_util.h"
#include "views/animator.h" #include "views/animator.h"
static const SkScalar kTabCapWidth = 15; static const SkScalar kTabCapWidth = 15;
...@@ -90,8 +91,8 @@ void Tab2::Paint(gfx::Canvas* canvas) { ...@@ -90,8 +91,8 @@ void Tab2::Paint(gfx::Canvas* canvas) {
canvas->drawPath(path, paint); canvas->drawPath(path, paint);
// TODO(beng): less ad-hoc // TODO(beng): less ad-hoc
canvas->DrawStringInt(model_->GetTitle(this), gfx::Font(), SK_ColorBLACK, canvas->DrawStringInt(UTF16ToWideHack(model_->GetTitle(this)), gfx::Font(),
5, 3, 100, 20); SK_ColorBLACK, 5, 3, 100, 20);
} }
bool Tab2::OnMousePressed(const views::MouseEvent& event) { bool Tab2::OnMousePressed(const views::MouseEvent& event) {
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
#include "app/gfx/canvas.h" #include "app/gfx/canvas.h"
#include "app/slide_animation.h" #include "app/slide_animation.h"
#include "app/win_util.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/message_loop.h" #include "base/message_loop.h"
#include "build/build_config.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "views/animator.h" #include "views/animator.h"
#include "views/screen.h" #include "views/screen.h"
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
#include "views/window/non_client_view.h" #include "views/window/non_client_view.h"
#include "views/window/window.h" #include "views/window/window.h"
#if defined(OS_WIN)
#include <windows.h>
#endif
static const int kHorizontalMoveThreshold = 16; // pixels static const int kHorizontalMoveThreshold = 16; // pixels
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
...@@ -144,7 +148,6 @@ bool TabStrip2::IsDragRearrange(TabStrip2* tabstrip, ...@@ -144,7 +148,6 @@ bool TabStrip2::IsDragRearrange(TabStrip2* tabstrip,
// prevent accidental detaches when rearranging horizontally. // prevent accidental detaches when rearranging horizontally.
static const int kVerticalDetachMagnetism = 45; static const int kVerticalDetachMagnetism = 45;
bool rearrange = true;
if (screen_point.x() < tabstrip_bounds_in_screen_coords.right() && if (screen_point.x() < tabstrip_bounds_in_screen_coords.right() &&
screen_point.x() >= tabstrip_bounds_in_screen_coords.x()) { screen_point.x() >= tabstrip_bounds_in_screen_coords.x()) {
int lower_threshold = int lower_threshold =
...@@ -226,7 +229,9 @@ bool TabStrip2::DragTab(Tab2* tab, const views::MouseEvent& drag_event) { ...@@ -226,7 +229,9 @@ bool TabStrip2::DragTab(Tab2* tab, const views::MouseEvent& drag_event) {
// mouse events will be sent to the appropriate window (the detached window) // mouse events will be sent to the appropriate window (the detached window)
// and so that we don't recursively create nested message loops (dragging // and so that we don't recursively create nested message loops (dragging
// is done by windows in a nested message loop). // is done by windows in a nested message loop).
#if defined(OS_WIN)
ReleaseCapture(); ReleaseCapture();
#endif
MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::current()->PostTask(FROM_HERE,
detach_factory_.NewRunnableMethod(&TabStrip2::DragDetachTabImpl, detach_factory_.NewRunnableMethod(&TabStrip2::DragDetachTabImpl,
tab, tab_index)); tab, tab_index));
...@@ -324,9 +329,11 @@ int TabStrip2::GetAnimateFlagsForLayoutSource(LayoutSource source) const { ...@@ -324,9 +329,11 @@ int TabStrip2::GetAnimateFlagsForLayoutSource(LayoutSource source) const {
case LS_TAB_DRAG_REORDER: case LS_TAB_DRAG_REORDER:
case LS_TAB_DRAG_NORMALIZE: case LS_TAB_DRAG_NORMALIZE:
return views::Animator::ANIMATE_X; return views::Animator::ANIMATE_X;
case LS_OTHER:
default:
DCHECK(source == LS_OTHER);
return views::Animator::ANIMATE_NONE;
} }
DCHECK(source == LS_OTHER);
return views::Animator::ANIMATE_NONE;
} }
void TabStrip2::LayoutImpl(LayoutSource source) { void TabStrip2::LayoutImpl(LayoutSource source) {
......
...@@ -2004,6 +2004,8 @@ ...@@ -2004,6 +2004,8 @@
['include', '^browser/views/tab_contents/tab_contents_view_gtk.h'], ['include', '^browser/views/tab_contents/tab_contents_view_gtk.h'],
['include', '^browser/views/tab_icon_view.cc'], ['include', '^browser/views/tab_icon_view.cc'],
['include', '^browser/views/tab_icon_view.h'], ['include', '^browser/views/tab_icon_view.h'],
['include', '^browser/views/tabs/browser_tab_strip.cc'],
['include', '^browser/views/tabs/browser_tab_strip.h'],
['include', '^browser/views/tabs/dragged_tab_controller.cc'], ['include', '^browser/views/tabs/dragged_tab_controller.cc'],
['include', '^browser/views/tabs/dragged_tab_controller.h'], ['include', '^browser/views/tabs/dragged_tab_controller.h'],
['include', '^browser/views/tabs/dragged_tab_view.cc'], ['include', '^browser/views/tabs/dragged_tab_view.cc'],
...@@ -2013,10 +2015,14 @@ ...@@ -2013,10 +2015,14 @@
['include', '^browser/views/tabs/native_view_photobooth_gtk.h'], ['include', '^browser/views/tabs/native_view_photobooth_gtk.h'],
['include', '^browser/views/tabs/tab.cc'], ['include', '^browser/views/tabs/tab.cc'],
['include', '^browser/views/tabs/tab.h'], ['include', '^browser/views/tabs/tab.h'],
['include', '^browser/views/tabs/tab_2.cc'],
['include', '^browser/views/tabs/tab_2.h'],
['include', '^browser/views/tabs/tab_renderer.cc'], ['include', '^browser/views/tabs/tab_renderer.cc'],
['include', '^browser/views/tabs/tab_renderer.h'], ['include', '^browser/views/tabs/tab_renderer.h'],
['include', '^browser/views/tabs/tab_strip.cc'], ['include', '^browser/views/tabs/tab_strip.cc'],
['include', '^browser/views/tabs/tab_strip.h'], ['include', '^browser/views/tabs/tab_strip.h'],
['include', '^browser/views/tabs/tab_strip_2.cc'],
['include', '^browser/views/tabs/tab_strip_2.h'],
['include', '^browser/views/toolbar_view.cc'], ['include', '^browser/views/toolbar_view.cc'],
['include', '^browser/views/toolbar_view.h'], ['include', '^browser/views/toolbar_view.h'],
['include', '^browser/window_sizer.cc'], ['include', '^browser/window_sizer.cc'],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment