diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-08 16:37:57 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-08 16:37:57 +0000 |
commit | 599cf87a7a2b7530d962eacda12759bab6276e1a (patch) | |
tree | 09002b874f81e1593046a0c102869ca9de0a9f50 /chrome/browser/views/tabs | |
parent | bf5c2ff3931c43b98095d33f8bc1b98379afe16f (diff) | |
download | chromium_src-599cf87a7a2b7530d962eacda12759bab6276e1a.zip chromium_src-599cf87a7a2b7530d962eacda12759bab6276e1a.tar.gz chromium_src-599cf87a7a2b7530d962eacda12759bab6276e1a.tar.bz2 |
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
Diffstat (limited to 'chrome/browser/views/tabs')
-rw-r--r-- | chrome/browser/views/tabs/tab_2.cc | 5 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_strip_2.cc | 15 |
2 files changed, 14 insertions, 6 deletions
diff --git a/chrome/browser/views/tabs/tab_2.cc b/chrome/browser/views/tabs/tab_2.cc index a541f3a..648d317 100644 --- a/chrome/browser/views/tabs/tab_2.cc +++ b/chrome/browser/views/tabs/tab_2.cc @@ -7,6 +7,7 @@ #include "app/gfx/canvas.h" #include "app/gfx/font.h" #include "app/gfx/path.h" +#include "base/string_util.h" #include "views/animator.h" static const SkScalar kTabCapWidth = 15; @@ -90,8 +91,8 @@ void Tab2::Paint(gfx::Canvas* canvas) { canvas->drawPath(path, paint); // TODO(beng): less ad-hoc - canvas->DrawStringInt(model_->GetTitle(this), gfx::Font(), SK_ColorBLACK, - 5, 3, 100, 20); + canvas->DrawStringInt(UTF16ToWideHack(model_->GetTitle(this)), gfx::Font(), + SK_ColorBLACK, 5, 3, 100, 20); } bool Tab2::OnMousePressed(const views::MouseEvent& event) { diff --git a/chrome/browser/views/tabs/tab_strip_2.cc b/chrome/browser/views/tabs/tab_strip_2.cc index 24ad751..1f24b2f 100644 --- a/chrome/browser/views/tabs/tab_strip_2.cc +++ b/chrome/browser/views/tabs/tab_strip_2.cc @@ -6,10 +6,10 @@ #include "app/gfx/canvas.h" #include "app/slide_animation.h" -#include "app/win_util.h" #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/message_loop.h" +#include "build/build_config.h" #include "chrome/common/chrome_switches.h" #include "views/animator.h" #include "views/screen.h" @@ -17,6 +17,10 @@ #include "views/window/non_client_view.h" #include "views/window/window.h" +#if defined(OS_WIN) +#include <windows.h> +#endif + static const int kHorizontalMoveThreshold = 16; // pixels //////////////////////////////////////////////////////////////////////////////// @@ -144,7 +148,6 @@ bool TabStrip2::IsDragRearrange(TabStrip2* tabstrip, // prevent accidental detaches when rearranging horizontally. static const int kVerticalDetachMagnetism = 45; - bool rearrange = true; if (screen_point.x() < tabstrip_bounds_in_screen_coords.right() && screen_point.x() >= tabstrip_bounds_in_screen_coords.x()) { int lower_threshold = @@ -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) // and so that we don't recursively create nested message loops (dragging // is done by windows in a nested message loop). +#if defined(OS_WIN) ReleaseCapture(); +#endif MessageLoop::current()->PostTask(FROM_HERE, detach_factory_.NewRunnableMethod(&TabStrip2::DragDetachTabImpl, tab, tab_index)); @@ -324,9 +329,11 @@ int TabStrip2::GetAnimateFlagsForLayoutSource(LayoutSource source) const { case LS_TAB_DRAG_REORDER: case LS_TAB_DRAG_NORMALIZE: 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) { |