diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-16 23:51:38 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-16 23:51:38 +0000 |
commit | c2dacc9ec41232903ba700c6aef5ef98bfcb8af8 (patch) | |
tree | 4aa4d7100862c64bdd92d70e6323001beb19edb7 /chrome/browser/views/tabs | |
parent | d66e710ec668e34271def44d7f0416260657171c (diff) | |
download | chromium_src-c2dacc9ec41232903ba700c6aef5ef98bfcb8af8.zip chromium_src-c2dacc9ec41232903ba700c6aef5ef98bfcb8af8.tar.gz chromium_src-c2dacc9ec41232903ba700c6aef5ef98bfcb8af8.tar.bz2 |
Rename ChromeViews namespace to views
http://crbug.com/2188
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3495 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/tabs')
-rw-r--r-- | chrome/browser/views/tabs/dragged_tab_controller.cc | 9 | ||||
-rw-r--r-- | chrome/browser/views/tabs/dragged_tab_controller.h | 6 | ||||
-rw-r--r-- | chrome/browser/views/tabs/dragged_tab_view.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/tabs/dragged_tab_view.h | 8 | ||||
-rw-r--r-- | chrome/browser/views/tabs/hwnd_photobooth.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/tabs/hwnd_photobooth.h | 4 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab.cc | 31 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab.h | 25 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_dragging_test.cc | 8 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_renderer.cc | 24 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_renderer.h | 12 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_strip.cc | 42 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_strip.h | 41 |
13 files changed, 106 insertions, 110 deletions
diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc index cdbcd98..4f20e57 100644 --- a/chrome/browser/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/views/tabs/dragged_tab_controller.cc @@ -72,7 +72,7 @@ class WindowFinder { gfx::Point ConvertScreenPointToTabStripPoint(TabStrip* tabstrip, const gfx::Point& screen_point) { gfx::Point tabstrip_topleft; - ChromeViews::View::ConvertPointToScreen(tabstrip, &tabstrip_topleft); + views::View::ConvertPointToScreen(tabstrip, &tabstrip_topleft); return gfx::Point(screen_point.x() - tabstrip_topleft.x(), screen_point.y() - tabstrip_topleft.y()); } @@ -273,7 +273,7 @@ void DraggedTabController::DidProcessMessage(const MSG& msg) { void DraggedTabController::InitWindowCreatePoint() { window_create_point_.SetPoint(mouse_offset_.x(), mouse_offset_.y()); Tab* first_tab = attached_tabstrip_->GetTabAt(0); - ChromeViews::View::ConvertPointToContainer(first_tab, &window_create_point_); + views::View::ConvertPointToContainer(first_tab, &window_create_point_); } gfx::Point DraggedTabController::GetWindowCreatePoint() const { @@ -723,10 +723,9 @@ gfx::Point DraggedTabController::GetCursorScreenPoint() const { return gfx::Point(pt); } -gfx::Rect DraggedTabController::GetViewScreenBounds( - ChromeViews::View* view) const { +gfx::Rect DraggedTabController::GetViewScreenBounds(views::View* view) const { gfx::Point view_topleft; - ChromeViews::View::ConvertPointToScreen(view, &view_topleft); + views::View::ConvertPointToScreen(view, &view_topleft); gfx::Rect view_screen_bounds = view->GetLocalBounds(true); view_screen_bounds.Offset(view_topleft.x(), view_topleft.y()); return view_screen_bounds; diff --git a/chrome/browser/views/tabs/dragged_tab_controller.h b/chrome/browser/views/tabs/dragged_tab_controller.h index 5874661..041d2337 100644 --- a/chrome/browser/views/tabs/dragged_tab_controller.h +++ b/chrome/browser/views/tabs/dragged_tab_controller.h @@ -11,7 +11,7 @@ #include "chrome/browser/views/tabs/tab_renderer.h" #include "chrome/common/notification_service.h" -namespace ChromeViews { +namespace views { class MouseEvent; class View; } @@ -192,7 +192,7 @@ class DraggedTabController : public TabContentsDelegate, gfx::Point GetCursorScreenPoint() const; // Returns the bounds (in screen coordinates) of the specified View. - gfx::Rect GetViewScreenBounds(ChromeViews::View* tabstrip) const; + gfx::Rect GetViewScreenBounds(views::View* tabstrip) const; // Utility to convert the specified TabStripModel index to something valid // for the attached TabStrip. @@ -270,7 +270,7 @@ class DraggedTabController : public TabContentsDelegate, // The last view that had focus in the window containing |source_tab_|. This // is saved so that focus can be restored properly when a drag begins and // ends within this same window. - ChromeViews::View* old_focused_view_; + views::View* old_focused_view_; bool in_destructor_; diff --git a/chrome/browser/views/tabs/dragged_tab_view.cc b/chrome/browser/views/tabs/dragged_tab_view.cc index ecbcadc..6e1fbb1 100644 --- a/chrome/browser/views/tabs/dragged_tab_view.cc +++ b/chrome/browser/views/tabs/dragged_tab_view.cc @@ -38,7 +38,7 @@ DraggedTabView::DraggedTabView(TabContents* datasource, renderer_->UpdateData(datasource); - container_ = new ChromeViews::ContainerWin; + container_ = new views::ContainerWin; container_->set_window_style(WS_POPUP); container_->set_window_ex_style( WS_EX_LAYERED | WS_EX_TOPMOST | WS_EX_TOOLWINDOW); @@ -138,7 +138,7 @@ void DraggedTabView::AnimationCanceled(const Animation* animation) { } /////////////////////////////////////////////////////////////////////////////// -// DraggedTabView, ChromeViews::View overrides: +// DraggedTabView, views::View overrides: void DraggedTabView::Paint(ChromeCanvas* canvas) { if (attached_) { diff --git a/chrome/browser/views/tabs/dragged_tab_view.h b/chrome/browser/views/tabs/dragged_tab_view.h index 0f4d626..6076acc 100644 --- a/chrome/browser/views/tabs/dragged_tab_view.h +++ b/chrome/browser/views/tabs/dragged_tab_view.h @@ -12,7 +12,7 @@ #include "chrome/views/view.h" #include "skia/include/SkBitmap.h" -namespace ChromeViews { +namespace views { class ContainerWin; } namespace gfx { @@ -23,7 +23,7 @@ class Tab; class TabContents; class TabRenderer; -class DraggedTabView : public ChromeViews::View, +class DraggedTabView : public views::View, public AnimationDelegate { public: DraggedTabView(TabContents* datasource, @@ -58,7 +58,7 @@ class DraggedTabView : public ChromeViews::View, virtual void AnimationEnded(const Animation* animation); virtual void AnimationCanceled(const Animation* animation); - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual void Paint(ChromeCanvas* canvas); virtual void Layout(); virtual gfx::Size GetPreferredSize(); @@ -76,7 +76,7 @@ class DraggedTabView : public ChromeViews::View, int ScaleValue(int value); // The window that contains the DraggedTabView. - ChromeViews::ContainerWin* container_; + views::ContainerWin* container_; // The renderer that paints the Tab shape. scoped_ptr<TabRenderer> renderer_; diff --git a/chrome/browser/views/tabs/hwnd_photobooth.cc b/chrome/browser/views/tabs/hwnd_photobooth.cc index 5096565..052c4aa 100644 --- a/chrome/browser/views/tabs/hwnd_photobooth.cc +++ b/chrome/browser/views/tabs/hwnd_photobooth.cc @@ -143,7 +143,7 @@ void HWNDPhotobooth::CreateCaptureWindow(HWND initial_hwnd) { gfx::Point window_position = GetCaptureWindowPosition(); gfx::Rect capture_bounds(window_position.x(), window_position.y(), contents_rect.Width(), contents_rect.Height()); - capture_window_ = new ChromeViews::ContainerWin; + capture_window_ = new views::ContainerWin; capture_window_->set_window_style(WS_POPUP); // WS_EX_TOOLWINDOW ensures the capture window doesn't produce a Taskbar // button. diff --git a/chrome/browser/views/tabs/hwnd_photobooth.h b/chrome/browser/views/tabs/hwnd_photobooth.h index d3f79bb..e3fb423 100644 --- a/chrome/browser/views/tabs/hwnd_photobooth.h +++ b/chrome/browser/views/tabs/hwnd_photobooth.h @@ -9,7 +9,7 @@ #include "base/gfx/rect.h" class ChromeCanvas; -namespace ChromeViews { +namespace views { class ContainerWin; } @@ -50,7 +50,7 @@ class HWNDPhotobooth { void CreateCaptureWindow(HWND initial_hwnd); // The nearly off-screen photo-booth layered window used to hold the HWND. - ChromeViews::ContainerWin* capture_window_; + views::ContainerWin* capture_window_; // The current HWND being captured. HWND current_hwnd_; diff --git a/chrome/browser/views/tabs/tab.cc b/chrome/browser/views/tabs/tab.cc index a64a073..e170b76 100644 --- a/chrome/browser/views/tabs/tab.cc +++ b/chrome/browser/views/tabs/tab.cc @@ -20,12 +20,12 @@ static const SkScalar kTabCapWidth = 15; static const SkScalar kTabTopCurveWidth = 4; static const SkScalar kTabBottomCurveWidth = 3; -class TabContextMenuController : public ChromeViews::MenuDelegate { +class TabContextMenuController : public views::MenuDelegate { public: explicit TabContextMenuController(Tab* tab) : tab_(tab), last_command_(TabStripModel::CommandFirst) { - menu_.reset(new ChromeViews::MenuItemView(this)); + menu_.reset(new views::MenuItemView(this)); menu_->AppendMenuItemWithLabel(TabStripModel::CommandNewTab, l10n_util::GetString(IDS_TAB_CXMENU_NEWTAB)); menu_->AppendSeparator(); @@ -54,11 +54,11 @@ class TabContextMenuController : public ChromeViews::MenuDelegate { void RunMenuAt(int x, int y) { menu_->RunMenuAt(tab_->GetContainer()->GetHWND(), gfx::Rect(x, y, 0, 0), - ChromeViews::MenuItemView::TOPLEFT, true); + views::MenuItemView::TOPLEFT, true); } private: - // ChromeViews::MenuDelegate implementation: + // views::MenuDelegate implementation: virtual bool IsCommandEnabled(int id) const { // The MenuItemView used to contain the contents of the Context Menu itself // has a command id of 0, and it will check to see if it's enabled for @@ -78,7 +78,7 @@ class TabContextMenuController : public ChromeViews::MenuDelegate { tab_); } - virtual void SelectionChanged(ChromeViews::MenuItemView* menu) { + virtual void SelectionChanged(views::MenuItemView* menu) { TabStripModel::ContextMenuCommand command = static_cast<TabStripModel::ContextMenuCommand>(menu->GetCommand()); tab_->delegate()->StopHighlightTabsForCommand(last_command_, tab_); @@ -88,7 +88,7 @@ class TabContextMenuController : public ChromeViews::MenuDelegate { private: // The context menu. - scoped_ptr<ChromeViews::MenuItemView> menu_; + scoped_ptr<views::MenuItemView> menu_; // The Tab the context menu was brought up for. Tab* tab_; @@ -124,7 +124,7 @@ bool Tab::IsSelected() const { } /////////////////////////////////////////////////////////////////////////////// -// Tab, ChromeViews::View overrides: +// Tab, views::View overrides: bool Tab::HasHitTestMask() const { return true; @@ -134,7 +134,7 @@ void Tab::GetHitTestMask(gfx::Path* mask) const { MakePathForTab(mask); } -bool Tab::OnMousePressed(const ChromeViews::MouseEvent& event) { +bool Tab::OnMousePressed(const views::MouseEvent& event) { if (event.IsOnlyLeftMouseButton()) { // Store whether or not we were selected just now... we only want to be // able to drag foreground tabs, so we don't start dragging the tab if @@ -147,13 +147,12 @@ bool Tab::OnMousePressed(const ChromeViews::MouseEvent& event) { return true; } -bool Tab::OnMouseDragged(const ChromeViews::MouseEvent& event) { +bool Tab::OnMouseDragged(const views::MouseEvent& event) { delegate_->ContinueDrag(event); return true; } -void Tab::OnMouseReleased(const ChromeViews::MouseEvent& event, - bool canceled) { +void Tab::OnMouseReleased(const views::MouseEvent& event, bool canceled) { // Notify the drag helper that we're done with any potential drag operations. // Clean up the drag helper, which is re-created on the next mouse press. delegate_->EndDrag(canceled); @@ -177,7 +176,7 @@ bool Tab::GetTooltipText(int x, int y, std::wstring* tooltip) { bool Tab::GetTooltipTextOrigin(int x, int y, CPoint* origin) { ChromeFont font; origin->x = title_bounds().x() + 10; - origin->y = -ChromeViews::TooltipManager::GetTooltipHeight() - 4; + origin->y = -views::TooltipManager::GetTooltipHeight() - 4; return true; } @@ -195,9 +194,9 @@ bool Tab::GetAccessibleName(std::wstring* name) { } /////////////////////////////////////////////////////////////////////////////// -// Tab, ChromeViews::ContextMenuController implementation: +// Tab, views::ContextMenuController implementation: -void Tab::ShowContextMenu(ChromeViews::View* source, int x, int y, +void Tab::ShowContextMenu(views::View* source, int x, int y, bool is_mouse_gesture) { TabContextMenuController controller(this); controller.RunMenuAt(x, y); @@ -205,9 +204,9 @@ void Tab::ShowContextMenu(ChromeViews::View* source, int x, int y, /////////////////////////////////////////////////////////////////////////////// -// ChromeViews::BaseButton::ButtonListener implementation: +// views::BaseButton::ButtonListener implementation: -void Tab::ButtonPressed(ChromeViews::BaseButton* sender) { +void Tab::ButtonPressed(views::BaseButton* sender) { if (sender == close_button()) delegate_->CloseTab(this); } diff --git a/chrome/browser/views/tabs/tab.h b/chrome/browser/views/tabs/tab.h index 369a39d..5534e82 100644 --- a/chrome/browser/views/tabs/tab.h +++ b/chrome/browser/views/tabs/tab.h @@ -24,8 +24,8 @@ class Profile; // /////////////////////////////////////////////////////////////////////////////// class Tab : public TabRenderer, - public ChromeViews::ContextMenuController, - public ChromeViews::BaseButton::ButtonListener { + public views::ContextMenuController, + public views::BaseButton::ButtonListener { public: static const std::string kTabClassName; @@ -60,11 +60,10 @@ class Tab : public TabRenderer, virtual void StopAllHighlighting() = 0; // Potentially starts a drag for the specified Tab. - virtual void MaybeStartDrag(Tab* tab, - const ChromeViews::MouseEvent& event) = 0; + virtual void MaybeStartDrag(Tab* tab, const views::MouseEvent& event) = 0; // Continues dragging a Tab. - virtual void ContinueDrag(const ChromeViews::MouseEvent& event) = 0; + virtual void ContinueDrag(const views::MouseEvent& event) = 0; // Ends dragging a Tab. |canceled| is true if the drag was aborted in a way // other than the user releasing the mouse. @@ -85,12 +84,12 @@ class Tab : public TabRenderer, virtual bool IsSelected() const; private: - // ChromeViews::View overrides: + // views::View overrides: virtual bool HasHitTestMask() const; virtual void GetHitTestMask(gfx::Path* mask) const; - virtual bool OnMousePressed(const ChromeViews::MouseEvent& event); - virtual bool OnMouseDragged(const ChromeViews::MouseEvent& event); - virtual void OnMouseReleased(const ChromeViews::MouseEvent& event, + virtual bool OnMousePressed(const views::MouseEvent& event); + virtual bool OnMouseDragged(const views::MouseEvent& event); + virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); virtual bool GetTooltipText(int x, int y, std::wstring* tooltip); virtual bool GetTooltipTextOrigin(int x, int y, CPoint* origin); @@ -98,14 +97,14 @@ class Tab : public TabRenderer, virtual bool GetAccessibleRole(VARIANT* role); virtual bool GetAccessibleName(std::wstring* name); - // ChromeViews::ContextMenuController overrides: - virtual void ShowContextMenu(ChromeViews::View* source, + // views::ContextMenuController overrides: + virtual void ShowContextMenu(views::View* source, int x, int y, bool is_mouse_gesture); - // ChromeViews::BaseButton::ButtonListener overrides: - virtual void ButtonPressed(ChromeViews::BaseButton* sender); + // views::BaseButton::ButtonListener overrides: + virtual void ButtonPressed(views::BaseButton* sender); // Creates a path that contains the clickable region of the tab's visual // representation. Used by GetViewForPoint for hit-testing. diff --git a/chrome/browser/views/tabs/tab_dragging_test.cc b/chrome/browser/views/tabs/tab_dragging_test.cc index 631a0f0..642d34f 100644 --- a/chrome/browser/views/tabs/tab_dragging_test.cc +++ b/chrome/browser/views/tabs/tab_dragging_test.cc @@ -113,7 +113,7 @@ TEST_F(TabDraggingTest, Tab1Tab2) { end.x = start.x + 2*bounds1.width()/3; end.y = start.y; ASSERT_TRUE(browser->SimulateDrag(start, end, - ChromeViews::Event::EF_LEFT_BUTTON_DOWN, + views::Event::EF_LEFT_BUTTON_DOWN, false)); // Now check for expected results. @@ -217,7 +217,7 @@ TEST_F(TabDraggingTest, Tab1Tab3) { end.x = start.x + bounds1.width()/2 + bounds2.width() + bounds3.width()/2; end.y = start.y; ASSERT_TRUE(browser->SimulateDrag(start, end, - ChromeViews::Event::EF_LEFT_BUTTON_DOWN, + views::Event::EF_LEFT_BUTTON_DOWN, false)); // Now check for expected results. @@ -331,7 +331,7 @@ TEST_F(TabDraggingTest, Tab1Tab3Escape) { // Simulate drag with 'true' as the last parameter. This will interrupt // in-flight with Escape. ASSERT_TRUE(browser->SimulateDrag(start, end, - ChromeViews::Event::EF_LEFT_BUTTON_DOWN, + views::Event::EF_LEFT_BUTTON_DOWN, true)); // Now check for expected results. @@ -457,7 +457,7 @@ TEST_F(TabDraggingTest, Tab2OutOfTabStrip) { // Simulate tab drag. ASSERT_TRUE(browser->SimulateDrag(start, end, - ChromeViews::Event::EF_LEFT_BUTTON_DOWN, + views::Event::EF_LEFT_BUTTON_DOWN, false)); // Now, first make sure that the old window has only two tabs remaining. diff --git a/chrome/browser/views/tabs/tab_renderer.cc b/chrome/browser/views/tabs/tab_renderer.cc index 99548a0..f1d00b3 100644 --- a/chrome/browser/views/tabs/tab_renderer.cc +++ b/chrome/browser/views/tabs/tab_renderer.cc @@ -164,24 +164,24 @@ int GetContentHeight() { // // This is a Button subclass that causes middle clicks to be forwarded to the // parent View by explicitly not handling them in OnMousePressed. -class TabCloseButton : public ChromeViews::Button { +class TabCloseButton : public views::Button { public: TabCloseButton() : Button() {} virtual ~TabCloseButton() {} - virtual bool OnMousePressed(const ChromeViews::MouseEvent& event) { + virtual bool OnMousePressed(const views::MouseEvent& event) { return !event.IsOnlyMiddleMouseButton(); } // We need to let the parent know about mouse state so that it // can highlight itself appropriately. Note that Exit events // fire before Enter events, so this works. - virtual void OnMouseEntered(const ChromeViews::MouseEvent& event) { + virtual void OnMouseEntered(const views::MouseEvent& event) { BaseButton::OnMouseEntered(event); GetParent()->OnMouseEntered(event); } - virtual void OnMouseExited(const ChromeViews::MouseEvent& event) { + virtual void OnMouseExited(const views::MouseEvent& event) { BaseButton::OnMouseExited(event); GetParent()->OnMouseExited(event); } @@ -247,9 +247,9 @@ TabRenderer::TabRenderer() // Add the Close Button. close_button_ = new TabCloseButton; - close_button_->SetImage(ChromeViews::Button::BS_NORMAL, close_button_n); - close_button_->SetImage(ChromeViews::Button::BS_HOT, close_button_h); - close_button_->SetImage(ChromeViews::Button::BS_PUSHED, close_button_p); + close_button_->SetImage(views::Button::BS_NORMAL, close_button_n); + close_button_->SetImage(views::Button::BS_HOT, close_button_h); + close_button_->SetImage(views::Button::BS_PUSHED, close_button_p); AddChildView(close_button_); hover_animation_.reset(new SlideAnimation(this)); @@ -364,7 +364,7 @@ std::wstring TabRenderer::GetTitle() const { } //////////////////////////////////////////////////////////////////////////////// -// TabRenderer, ChromeViews::View overrides: +// TabRenderer, views::View overrides: void TabRenderer::Paint(ChromeCanvas* canvas) { // Don't paint if we're narrower than we can render correctly. (This should @@ -507,8 +507,8 @@ void TabRenderer::Layout() { // are not represented as child Views (which is the preferred method). // Instead, these UI elements are drawn directly on the canvas from within // Tab::Paint(). The Tab's child Views (for example, the Tab's close button - // which is a ChromeViews::Button instance) are automatically mirrored by the - // mirroring infrastructure in ChromeViews. The elements Tab draws directly + // which is a views::Button instance) are automatically mirrored by the + // mirroring infrastructure in views. The elements Tab draws directly // on the canvas need to be manually mirrored if the View's layout is // right-to-left. favicon_bounds_.set_x(MirroredLeftPointForRect(favicon_bounds_)); @@ -516,12 +516,12 @@ void TabRenderer::Layout() { download_icon_bounds_.set_x(MirroredLeftPointForRect(download_icon_bounds_)); } -void TabRenderer::OnMouseEntered(const ChromeViews::MouseEvent& e) { +void TabRenderer::OnMouseEntered(const views::MouseEvent& e) { hover_animation_->SetTweenType(SlideAnimation::EASE_OUT); hover_animation_->Show(); } -void TabRenderer::OnMouseExited(const ChromeViews::MouseEvent& e) { +void TabRenderer::OnMouseExited(const views::MouseEvent& e) { hover_animation_->SetTweenType(SlideAnimation::EASE_IN); hover_animation_->Hide(); } diff --git a/chrome/browser/views/tabs/tab_renderer.h b/chrome/browser/views/tabs/tab_renderer.h index a956b1b..9cad816 100644 --- a/chrome/browser/views/tabs/tab_renderer.h +++ b/chrome/browser/views/tabs/tab_renderer.h @@ -22,7 +22,7 @@ class TabContents; // A View that renders a Tab, either in a TabStrip or in a DraggedTabView. // /////////////////////////////////////////////////////////////////////////////// -class TabRenderer : public ChromeViews::View, +class TabRenderer : public views::View, public AnimationDelegate { public: // Possible animation states. @@ -64,18 +64,18 @@ class TabRenderer : public ChromeViews::View, static gfx::Size GetStandardSize(); protected: - ChromeViews::Button* close_button() const { return close_button_; } + views::Button* close_button() const { return close_button_; } const gfx::Rect& title_bounds() const { return title_bounds_; } // Returns the title of the Tab. std::wstring GetTitle() const; private: - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual void Paint(ChromeCanvas* canvas); virtual void Layout(); - virtual void OnMouseEntered(const ChromeViews::MouseEvent& event); - virtual void OnMouseExited(const ChromeViews::MouseEvent& event); + virtual void OnMouseEntered(const views::MouseEvent& event); + virtual void OnMouseExited(const views::MouseEvent& event); // Overridden from AnimationDelegate: virtual void AnimationProgressed(const Animation* animation); @@ -124,7 +124,7 @@ class TabRenderer : public ChromeViews::View, int animation_frame_; // Close Button. - ChromeViews::Button* close_button_; + views::Button* close_button_; // Hover animation. scoped_ptr<SlideAnimation> hover_animation_; diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc index f487074..72f7d28 100644 --- a/chrome/browser/views/tabs/tab_strip.cc +++ b/chrome/browser/views/tabs/tab_strip.cc @@ -32,7 +32,7 @@ #undef min #undef max -using ChromeViews::DropTargetEvent; +using views::DropTargetEvent; static const int kDefaultAnimationDurationMs = 100; static const int kResizeLayoutAnimationDurationMs = 166; @@ -60,13 +60,13 @@ static inline int Round(double x) { // // A subclass of button that hit-tests to the shape of the new tab button. -class NewTabButton : public ChromeViews::Button { +class NewTabButton : public views::Button { public: NewTabButton() {} virtual ~NewTabButton() {} protected: - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual bool HasHitTestMask() const { return true; } @@ -355,7 +355,7 @@ class RemoveTabAnimation : public TabStrip::TabAnimation { POINT pt; GetCursorPos(&pt); - ChromeViews::Container* vc = tabstrip_->GetContainer(); + views::Container* vc = tabstrip_->GetContainer(); RECT wr; GetWindowRect(vc->GetHWND(), &wr); pt.x -= wr.left; @@ -526,7 +526,7 @@ bool TabStrip::CanProcessInputEvents() const { } bool TabStrip::PointIsWithinWindowCaption(const gfx::Point& point) { - ChromeViews::View* v = GetViewForPoint(point); + views::View* v = GetViewForPoint(point); // If there is no control at this location, claim the hit was in the title // bar to get a move action. @@ -596,7 +596,7 @@ gfx::Rect TabStrip::GetIdealBounds(int index) { } /////////////////////////////////////////////////////////////////////////////// -// TabStrip, ChromeViews::View overrides: +// TabStrip, views::View overrides: void TabStrip::PaintChildren(ChromeCanvas* canvas) { // Paint the tabs in reverse order, so they stack to the left. @@ -634,7 +634,7 @@ void TabStrip::PaintChildren(ChromeCanvas* canvas) { } // Overridden to support automation. See automation_proxy_uitest.cc. -ChromeViews::View* TabStrip::GetViewByID(int view_id) const { +views::View* TabStrip::GetViewByID(int view_id) const { if (GetTabCount() > 0) { if (view_id == VIEW_ID_TAB_LAST) { return GetTabAt(GetTabCount() - 1); @@ -742,15 +742,15 @@ void TabStrip::SetAccessibleName(const std::wstring& name) { accessible_name_.assign(name); } -ChromeViews::View* TabStrip::GetViewForPoint(const gfx::Point& point) { +views::View* TabStrip::GetViewForPoint(const gfx::Point& point) { return GetViewForPoint(point, false); } -ChromeViews::View* TabStrip::GetViewForPoint(const gfx::Point& point, - bool can_create_floating) { +views::View* TabStrip::GetViewForPoint(const gfx::Point& point, + bool can_create_floating) { // Return any view that isn't a Tab or this TabStrip immediately. We don't // want to interfere. - ChromeViews::View* v = View::GetViewForPoint(point, can_create_floating); + views::View* v = View::GetViewForPoint(point, can_create_floating); if (v && v != this && v->GetClassName() != Tab::kTabClassName) return v; @@ -1004,7 +1004,7 @@ void TabStrip::StopAllHighlighting() { GetTabAt(i)->StopPulse(); } -void TabStrip::MaybeStartDrag(Tab* tab, const ChromeViews::MouseEvent& event) { +void TabStrip::MaybeStartDrag(Tab* tab, const views::MouseEvent& event) { // Don't accidentally start any drag operations during animations if the // mouse is down... during an animation tabs are being resized automatically, // so the View system can misinterpret this easily if the mouse is down that @@ -1015,7 +1015,7 @@ void TabStrip::MaybeStartDrag(Tab* tab, const ChromeViews::MouseEvent& event) { drag_controller_->CaptureDragInfo(gfx::Point(event.x(), event.y())); } -void TabStrip::ContinueDrag(const ChromeViews::MouseEvent& event) { +void TabStrip::ContinueDrag(const views::MouseEvent& event) { // We can get called even if |MaybeStartDrag| wasn't called in the event of // a TabStrip animation when the mouse button is down. In this case we should // _not_ continue the drag because it can lead to weird bugs. @@ -1029,9 +1029,9 @@ void TabStrip::EndDrag(bool canceled) { } /////////////////////////////////////////////////////////////////////////////// -// TabStrip, ChromeViews::BaseButton::ButtonListener implementation: +// TabStrip, views::BaseButton::ButtonListener implementation: -void TabStrip::ButtonPressed(ChromeViews::BaseButton* sender) { +void TabStrip::ButtonPressed(views::BaseButton* sender) { if (sender == newtab_button_) model_->AddBlankTab(true); } @@ -1101,10 +1101,10 @@ void TabStrip::Init() { SkBitmap* bitmap; bitmap = rb.GetBitmapNamed(IDR_NEWTAB_BUTTON); - newtab_button_->SetImage(ChromeViews::Button::BS_NORMAL, bitmap); - newtab_button_->SetImage(ChromeViews::Button::BS_PUSHED, + newtab_button_->SetImage(views::Button::BS_NORMAL, bitmap); + newtab_button_->SetImage(views::Button::BS_PUSHED, rb.GetBitmapNamed(IDR_NEWTAB_BUTTON_P)); - newtab_button_->SetImage(ChromeViews::Button::BS_HOT, + newtab_button_->SetImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_NEWTAB_BUTTON_H)); newtab_button_size_.SetSize(bitmap->width(), bitmap->height()); @@ -1375,7 +1375,7 @@ void TabStrip::SetDropIndex(int index, bool drop_before) { drop_bounds.height(), SWP_NOACTIVATE | SWP_SHOWWINDOW); } -int TabStrip::GetDropEffect(const ChromeViews::DropTargetEvent& event) { +int TabStrip::GetDropEffect(const views::DropTargetEvent& event) { const int source_ops = event.GetSourceOperations(); if (source_ops & DragDropTypes::DRAG_COPY) return DragDropTypes::DRAG_COPY; @@ -1396,12 +1396,12 @@ 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_window = new ChromeViews::ContainerWin(); + arrow_window = new views::ContainerWin; 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 ChromeViews::ImageView; + arrow_view = new views::ImageView; arrow_view->SetImage(GetDropArrowImage(point_down)); arrow_window->Init( diff --git a/chrome/browser/views/tabs/tab_strip.h b/chrome/browser/views/tabs/tab_strip.h index 3f464a8..3b96279e 100644 --- a/chrome/browser/views/tabs/tab_strip.h +++ b/chrome/browser/views/tabs/tab_strip.h @@ -17,7 +17,7 @@ class DraggedTabController; class ScopedMouseCloseWidthCalculator; class TabStripModel; -namespace ChromeViews { +namespace views { class ImageView; } @@ -34,10 +34,10 @@ class ImageView; // in response to dragged tabs. // /////////////////////////////////////////////////////////////////////////////// -class TabStrip : public ChromeViews::View, +class TabStrip : public views::View, public TabStripModelObserver, public Tab::TabDelegate, - public ChromeViews::Button::ButtonListener, + public views::Button::ButtonListener, public MessageLoopForUI::Observer { public: TabStrip(TabStripModel* model); @@ -96,23 +96,23 @@ class TabStrip : public ChromeViews::View, // Retrieve the ideal bounds for the Tab at the specified index. gfx::Rect GetIdealBounds(int index); - // ChromeViews::View overrides: + // views::View overrides: virtual void PaintChildren(ChromeCanvas* canvas); - virtual ChromeViews::View* GetViewByID(int id) const; + virtual views::View* GetViewByID(int id) const; virtual void Layout(); virtual gfx::Size GetPreferredSize(); // NOTE: the drag and drop methods are invoked from FrameView. This is done to // allow for a drop region that extends outside the bounds of the TabStrip. - virtual void OnDragEntered(const ChromeViews::DropTargetEvent& event); - virtual int OnDragUpdated(const ChromeViews::DropTargetEvent& event); + virtual void OnDragEntered(const views::DropTargetEvent& event); + virtual int OnDragUpdated(const views::DropTargetEvent& event); virtual void OnDragExited(); - virtual int OnPerformDrop(const ChromeViews::DropTargetEvent& event); + virtual int OnPerformDrop(const views::DropTargetEvent& event); virtual bool GetAccessibleRole(VARIANT* role); virtual bool GetAccessibleName(std::wstring* name); virtual void SetAccessibleName(const std::wstring& name); - virtual ChromeViews::View* GetViewForPoint(const gfx::Point& point); - virtual ChromeViews::View* GetViewForPoint(const gfx::Point& point, - bool can_create_floating); + virtual views::View* GetViewForPoint(const gfx::Point& point); + virtual views::View* GetViewForPoint(const gfx::Point& point, + bool can_create_floating); protected: // TabStripModelObserver implementation: @@ -141,13 +141,12 @@ class TabStrip : public ChromeViews::View, virtual void StopHighlightTabsForCommand( TabStripModel::ContextMenuCommand command_id, Tab* tab); virtual void StopAllHighlighting(); - virtual void MaybeStartDrag(Tab* tab, - const ChromeViews::MouseEvent& event); - virtual void ContinueDrag(const ChromeViews::MouseEvent& event); + virtual void MaybeStartDrag(Tab* tab, const views::MouseEvent& event); + virtual void ContinueDrag(const views::MouseEvent& event); virtual void EndDrag(bool canceled); - // ChromeViews::Button::ButtonListener implementation: - virtual void ButtonPressed(ChromeViews::BaseButton* sender); + // views::Button::ButtonListener implementation: + virtual void ButtonPressed(views::BaseButton* sender); // MessageLoop::Observer implementation: virtual void WillProcessMessage(const MSG& msg); @@ -220,14 +219,14 @@ class TabStrip : public ChromeViews::View, gfx::Rect GetDropBounds(int drop_index, bool drop_before, bool* is_beneath); // Updates the location of the drop based on the event. - void UpdateDropIndex(const ChromeViews::DropTargetEvent& event); + void UpdateDropIndex(const views::DropTargetEvent& event); // Sets the location of the drop, repainting as necessary. void SetDropIndex(int index, bool drop_before); // Returns the drop effect for dropping a URL on the tab strip. This does // not query the data in anyway, it only looks at the source operations. - int GetDropEffect(const ChromeViews::DropTargetEvent& event); + int GetDropEffect(const views::DropTargetEvent& event); // Returns the image to use for indicating a drop on a tab. If is_down is // true, this returns an arrow pointing down. @@ -299,7 +298,7 @@ class TabStrip : public ChromeViews::View, base::RepeatingTimer<TabStrip> loading_animation_timer_; // The "New Tab" button. - ChromeViews::Button* newtab_button_; + views::Button* newtab_button_; gfx::Size newtab_button_size_; gfx::Size actual_newtab_button_size_; @@ -341,8 +340,8 @@ class TabStrip : public ChromeViews::View, bool point_down; // Renders the drop indicator. - ChromeViews::ContainerWin* arrow_window; - ChromeViews::ImageView* arrow_view; + views::ContainerWin* arrow_window; + views::ImageView* arrow_view; private: DISALLOW_EVIL_CONSTRUCTORS(DropInfo); |