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/frame | |
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/frame')
-rw-r--r-- | chrome/browser/views/frame/aero_glass_frame.cc | 11 | ||||
-rw-r--r-- | chrome/browser/views/frame/aero_glass_frame.h | 13 | ||||
-rw-r--r-- | chrome/browser/views/frame/aero_glass_non_client_view.cc | 10 | ||||
-rw-r--r-- | chrome/browser/views/frame/aero_glass_non_client_view.h | 10 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_frame.h | 6 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 14 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.h | 18 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view2.cc | 78 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view2.h | 55 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_frame.cc | 11 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_frame.h | 15 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_non_client_view.cc | 119 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_non_client_view.h | 44 |
13 files changed, 198 insertions, 206 deletions
diff --git a/chrome/browser/views/frame/aero_glass_frame.cc b/chrome/browser/views/frame/aero_glass_frame.cc index 7810cac..f38735a 100644 --- a/chrome/browser/views/frame/aero_glass_frame.cc +++ b/chrome/browser/views/frame/aero_glass_frame.cc @@ -86,12 +86,12 @@ void AeroGlassFrame::UpdateThrobber(bool running) { } } -ChromeViews::Window* AeroGlassFrame::GetWindow() { +views::Window* AeroGlassFrame::GetWindow() { return this; } /////////////////////////////////////////////////////////////////////////////// -// AeroGlassFrame, ChromeViews::ContainerWin implementation: +// AeroGlassFrame, views::ContainerWin implementation: void AeroGlassFrame::OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu) { @@ -183,15 +183,14 @@ LRESULT AeroGlassFrame::OnNCHitTest(const CPoint& pt) { } /////////////////////////////////////////////////////////////////////////////// -// AeroGlassFrame, ChromeViews::ContainerWin overrides: +// AeroGlassFrame, views::ContainerWin overrides: -bool AeroGlassFrame::AcceleratorPressed( - ChromeViews::Accelerator* accelerator) { +bool AeroGlassFrame::AcceleratorPressed(views::Accelerator* accelerator) { return browser_view_->AcceleratorPressed(*accelerator); } bool AeroGlassFrame::GetAccelerator(int cmd_id, - ChromeViews::Accelerator* accelerator) { + views::Accelerator* accelerator) { return browser_view_->GetAccelerator(cmd_id, accelerator); } diff --git a/chrome/browser/views/frame/aero_glass_frame.h b/chrome/browser/views/frame/aero_glass_frame.h index ccdec53..09e391a 100644 --- a/chrome/browser/views/frame/aero_glass_frame.h +++ b/chrome/browser/views/frame/aero_glass_frame.h @@ -19,7 +19,7 @@ class BrowserView2; // areas are drawn by the system. // class AeroGlassFrame : public BrowserFrame, - public ChromeViews::Window { + public views::Window { public: explicit AeroGlassFrame(BrowserView2* browser_view); virtual ~AeroGlassFrame(); @@ -36,15 +36,14 @@ class AeroGlassFrame : public BrowserFrame, virtual void SizeToContents(const gfx::Rect& contents_bounds) {} virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const; virtual void UpdateThrobber(bool running); - virtual ChromeViews::Window* GetWindow(); + virtual views::Window* GetWindow(); - // Overridden from ChromeViews::ContainerWin: - virtual bool AcceleratorPressed(ChromeViews::Accelerator* accelerator); - virtual bool GetAccelerator(int cmd_id, - ChromeViews::Accelerator* accelerator); + // Overridden from views::ContainerWin: + virtual bool AcceleratorPressed(views::Accelerator* accelerator); + virtual bool GetAccelerator(int cmd_id, views::Accelerator* accelerator); protected: - // Overridden from ChromeViews::ContainerWin: + // Overridden from views::ContainerWin: virtual void OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu); virtual void OnEndSession(BOOL ending, UINT logoff); virtual void OnExitMenuLoop(bool is_track_popup_menu); diff --git a/chrome/browser/views/frame/aero_glass_non_client_view.cc b/chrome/browser/views/frame/aero_glass_non_client_view.cc index 65b9f9d..e48214e 100644 --- a/chrome/browser/views/frame/aero_glass_non_client_view.cc +++ b/chrome/browser/views/frame/aero_glass_non_client_view.cc @@ -37,7 +37,7 @@ class AeroGlassWindowResources { AeroGlassWindowResources() { InitClass(); } virtual ~AeroGlassWindowResources() { } - virtual SkBitmap* GetPartBitmap(FramePartBitmap part) const { + virtual SkBitmap* GetPartBitmap(views::FramePartBitmap part) const { return standard_frame_bitmaps_[part]; } @@ -156,7 +156,7 @@ gfx::Rect AeroGlassNonClientView::GetBoundsForTabStrip(TabStrip* tabstrip) { } /////////////////////////////////////////////////////////////////////////////// -// AeroGlassNonClientView, ChromeViews::NonClientView implementation: +// AeroGlassNonClientView, views::NonClientView implementation: gfx::Rect AeroGlassNonClientView::CalculateClientAreaBounds(int win_width, int win_height) const { @@ -225,7 +225,7 @@ void AeroGlassNonClientView::EnableClose(bool enable) { } /////////////////////////////////////////////////////////////////////////////// -// AeroGlassNonClientView, ChromeViews::View overrides: +// AeroGlassNonClientView, views::View overrides: void AeroGlassNonClientView::Paint(ChromeCanvas* canvas) { PaintOTRAvatar(canvas); @@ -251,8 +251,8 @@ gfx::Size AeroGlassNonClientView::GetPreferredSize() { } void AeroGlassNonClientView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (is_add && child == this) { DCHECK(GetContainer()); DCHECK(frame_->client_view()->GetParent() != this); diff --git a/chrome/browser/views/frame/aero_glass_non_client_view.h b/chrome/browser/views/frame/aero_glass_non_client_view.h index 2814918..f78d8c1 100644 --- a/chrome/browser/views/frame/aero_glass_non_client_view.h +++ b/chrome/browser/views/frame/aero_glass_non_client_view.h @@ -12,7 +12,7 @@ class BrowserView2; class AeroGlassWindowResources; -class AeroGlassNonClientView : public ChromeViews::NonClientView { +class AeroGlassNonClientView : public views::NonClientView { public: // Constructs a non-client view for an AeroGlassFrame. AeroGlassNonClientView(AeroGlassFrame* frame, BrowserView2* browser_view); @@ -21,7 +21,7 @@ class AeroGlassNonClientView : public ChromeViews::NonClientView { gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip); protected: - // Overridden from ChromeViews::NonClientView: + // Overridden from views::NonClientView: virtual gfx::Rect CalculateClientAreaBounds(int width, int height) const; virtual gfx::Size CalculateWindowSizeForClientSize(int width, int height) const; @@ -30,13 +30,13 @@ class AeroGlassNonClientView : public ChromeViews::NonClientView { virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); virtual void EnableClose(bool enable); - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual void Paint(ChromeCanvas* canvas); virtual void Layout(); virtual gfx::Size GetPreferredSize(); virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); private: // Returns the height of the non-client area at the top of the window (the diff --git a/chrome/browser/views/frame/browser_frame.h b/chrome/browser/views/frame/browser_frame.h index 5292a59..e7f2d4f 100644 --- a/chrome/browser/views/frame/browser_frame.h +++ b/chrome/browser/views/frame/browser_frame.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_VIEWS_FRAME_BROWSER_FRAME_H_ class BrowserView2; -namespace ChromeViews { +namespace views { class Window; } namespace gfx { @@ -41,8 +41,8 @@ class BrowserFrame { // |running| is whether or not the throbber should be running. virtual void UpdateThrobber(bool running) = 0; - // Returns the ChromeViews::Window associated with this frame. - virtual ChromeViews::Window* GetWindow() = 0; + // Returns the views::Window associated with this frame. + virtual views::Window* GetWindow() = 0; enum FrameType { FRAMETYPE_OPAQUE, diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 7e8303d..038b26c 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -29,8 +29,8 @@ static const int kStatusBubbleOffset = 2; BrowserView::BrowserView(BrowserWindow* frame, Browser* browser, - ChromeViews::Window* window, - ChromeViews::View* contents_view) + views::Window* window, + views::View* contents_view) : frame_(frame), browser_(browser), initialized_(false) @@ -123,7 +123,7 @@ void BrowserView::SizeToContents(const gfx::Rect& contents_bounds) { } void BrowserView::SetAcceleratorTable( - std::map<ChromeViews::Accelerator, int>* accelerator_table) { + std::map<views::Accelerator, int>* accelerator_table) { frame_->SetAcceleratorTable(accelerator_table); } @@ -201,7 +201,7 @@ bool BrowserView::IsBookmarkBarVisible() const { } /////////////////////////////////////////////////////////////////////////////// -// BrowserView, ChromeViews::ClientView overrides: +// BrowserView, views::ClientView overrides: /* bool BrowserView::CanClose() const { @@ -214,15 +214,15 @@ int BrowserView::NonClientHitTest(const gfx::Point& point) { */ /////////////////////////////////////////////////////////////////////////////// -// BrowserView, ChromeViews::View overrides: +// BrowserView, views::View overrides: void BrowserView::Layout() { toolbar_->SetBounds(0, 0, width(), height()); } void BrowserView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (is_add && child == this && GetContainer() && !initialized_) { Init(); // Make sure not to call Init() twice if we get inserted into a different diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h index 704d6a7..5d81317 100644 --- a/chrome/browser/views/frame/browser_view.h +++ b/chrome/browser/views/frame/browser_view.h @@ -21,13 +21,13 @@ class BrowserToolbarView; // including the TabStrip, toolbars, download shelves, the content area etc. // class BrowserView : public BrowserWindow, -/* public ChromeViews::ClientView */ - public ChromeViews::View { +/* public views::ClientView */ + public views::View { public: BrowserView(BrowserWindow* frame, Browser* browser, - ChromeViews::Window* window, - ChromeViews::View* contents_view); + views::Window* window, + views::View* contents_view); virtual ~BrowserView(); // TODO(beng): remove this once all layout is done inside this object. @@ -53,7 +53,7 @@ class BrowserView : public BrowserWindow, int frame_component); virtual void SizeToContents(const gfx::Rect& contents_bounds); virtual void SetAcceleratorTable( - std::map<ChromeViews::Accelerator, int>* accelerator_table); + std::map<views::Accelerator, int>* accelerator_table); virtual void ValidateThrobber(); virtual gfx::Rect GetNormalBounds(); virtual bool IsMaximized(); @@ -72,16 +72,16 @@ class BrowserView : public BrowserWindow, virtual bool IsBookmarkBarVisible() const; /* - // Overridden from ChromeViews::ClientView: + // Overridden from views::ClientView: virtual bool CanClose() const; virtual int NonClientHitTest(const gfx::Point& point); */ - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual void Layout(); virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); private: // The Browser object we are associated with. diff --git a/chrome/browser/views/frame/browser_view2.cc b/chrome/browser/views/frame/browser_view2.cc index c1e3588..afa5f3c 100644 --- a/chrome/browser/views/frame/browser_view2.cc +++ b/chrome/browser/views/frame/browser_view2.cc @@ -151,10 +151,9 @@ bool BrowserView2::ShouldShowOffTheRecordAvatar() const { browser_->GetType() == BrowserType::TABBED_BROWSER; } -bool BrowserView2::AcceleratorPressed( - const ChromeViews::Accelerator& accelerator) { +bool BrowserView2::AcceleratorPressed(const views::Accelerator& accelerator) { DCHECK(accelerator_table_.get()); - std::map<ChromeViews::Accelerator, int>::const_iterator iter = + std::map<views::Accelerator, int>::const_iterator iter = accelerator_table_->find(accelerator); DCHECK(iter != accelerator_table_->end()); @@ -168,8 +167,8 @@ bool BrowserView2::AcceleratorPressed( } bool BrowserView2::GetAccelerator(int cmd_id, - ChromeViews::Accelerator* accelerator) { - std::map<ChromeViews::Accelerator, int>::iterator it = + views::Accelerator* accelerator) { + std::map<views::Accelerator, int>::iterator it = accelerator_table_->begin(); for (; it != accelerator_table_->end(); ++it) { if (it->second == cmd_id) { @@ -192,7 +191,7 @@ bool BrowserView2::SystemCommandReceived(UINT notification_code, return handled; } -void BrowserView2::AddViewToDropList(ChromeViews::View* view) { +void BrowserView2::AddViewToDropList(views::View* view) { dropable_views_.insert(view); } @@ -392,7 +391,7 @@ void BrowserView2::SizeToContents(const gfx::Rect& contents_bounds) { } void BrowserView2::SetAcceleratorTable( - std::map<ChromeViews::Accelerator, int>* accelerator_table) { + std::map<views::Accelerator, int>* accelerator_table) { accelerator_table_.reset(accelerator_table); } @@ -547,7 +546,7 @@ void BrowserView2::TabStripEmpty() { } /////////////////////////////////////////////////////////////////////////////// -// BrowserView2, ChromeViews::WindowDelegate implementation: +// BrowserView2, views::WindowDelegate implementation: bool BrowserView2::CanResize() const { return true; @@ -565,7 +564,7 @@ std::wstring BrowserView2::GetWindowTitle() const { return browser_->GetCurrentPageTitle(); } -ChromeViews::View* BrowserView2::GetInitiallyFocusedView() const { +views::View* BrowserView2::GetInitiallyFocusedView() const { return GetLocationBarView(); } @@ -658,18 +657,17 @@ bool BrowserView2::RestoreWindowPosition(CRect* bounds, void BrowserView2::WindowClosing() { } -ChromeViews::View* BrowserView2::GetContentsView() { +views::View* BrowserView2::GetContentsView() { return contents_container_; } -ChromeViews::ClientView* BrowserView2::CreateClientView( - ChromeViews::Window* window) { +views::ClientView* BrowserView2::CreateClientView(views::Window* window) { set_window(window); return this; } /////////////////////////////////////////////////////////////////////////////// -// BrowserView2, ChromeViews::ClientView overrides: +// BrowserView2, views::ClientView overrides: bool BrowserView2::CanClose() const { // You cannot close a frame for which there is an active originating drag @@ -708,7 +706,7 @@ int BrowserView2::NonClientHitTest(const gfx::Point& point) { // might be a popup window without a TabStrip, or the TabStrip could be // animating. if (IsTabStripVisible() && tabstrip_->CanProcessInputEvents()) { - ChromeViews::Window* window = frame_->GetWindow(); + views::Window* window = frame_->GetWindow(); gfx::Point point_in_view_coords(point); View::ConvertPointToView(GetParent(), this, &point_in_view_coords); @@ -762,7 +760,7 @@ int BrowserView2::NonClientHitTest(const gfx::Point& point) { } /////////////////////////////////////////////////////////////////////////////// -// BrowserView2, ChromeViews::View overrides: +// BrowserView2, views::View overrides: void BrowserView2::Layout() { int top = LayoutTabStrip(); @@ -783,8 +781,8 @@ void BrowserView2::Layout() { } void BrowserView2::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (is_add && child == this && GetContainer() && !initialized_) { Init(); initialized_ = true; @@ -799,19 +797,19 @@ bool BrowserView2::CanDrop(const OSExchangeData& data) { return can_drop_; } -void BrowserView2::OnDragEntered(const ChromeViews::DropTargetEvent& event) { +void BrowserView2::OnDragEntered(const views::DropTargetEvent& event) { if (can_drop_ && ShouldForwardToTabStrip(event)) { forwarding_to_tab_strip_ = true; - scoped_ptr<ChromeViews::DropTargetEvent> mapped_event( + scoped_ptr<views::DropTargetEvent> mapped_event( MapEventToTabStrip(event)); tabstrip_->OnDragEntered(*mapped_event.get()); } } -int BrowserView2::OnDragUpdated(const ChromeViews::DropTargetEvent& event) { +int BrowserView2::OnDragUpdated(const views::DropTargetEvent& event) { if (can_drop_) { if (ShouldForwardToTabStrip(event)) { - scoped_ptr<ChromeViews::DropTargetEvent> mapped_event( + scoped_ptr<views::DropTargetEvent> mapped_event( MapEventToTabStrip(event)); if (!forwarding_to_tab_strip_) { tabstrip_->OnDragEntered(*mapped_event.get()); @@ -833,10 +831,10 @@ void BrowserView2::OnDragExited() { } } -int BrowserView2::OnPerformDrop(const ChromeViews::DropTargetEvent& event) { +int BrowserView2::OnPerformDrop(const views::DropTargetEvent& event) { if (forwarding_to_tab_strip_) { forwarding_to_tab_strip_ = false; - scoped_ptr<ChromeViews::DropTargetEvent> mapped_event( + scoped_ptr<views::DropTargetEvent> mapped_event( MapEventToTabStrip(event)); return tabstrip_->OnPerformDrop(*mapped_event.get()); } @@ -848,7 +846,7 @@ int BrowserView2::OnPerformDrop(const ChromeViews::DropTargetEvent& event) { // BrowserView2, private: bool BrowserView2::ShouldForwardToTabStrip( - const ChromeViews::DropTargetEvent& event) { + const views::DropTargetEvent& event) { if (!tabstrip_->IsVisible()) return false; @@ -863,18 +861,18 @@ bool BrowserView2::ShouldForwardToTabStrip( // Mouse isn't over the tab strip. Only forward if the mouse isn't over // another view on the tab strip or is over a view we were told the user can // drop on. - ChromeViews::View* view_over_mouse = GetViewForPoint(event.location()); + views::View* view_over_mouse = GetViewForPoint(event.location()); return (view_over_mouse == this || view_over_mouse == tabstrip_ || dropable_views_.find(view_over_mouse) != dropable_views_.end()); } -ChromeViews::DropTargetEvent* BrowserView2::MapEventToTabStrip( - const ChromeViews::DropTargetEvent& event) { +views::DropTargetEvent* BrowserView2::MapEventToTabStrip( + const views::DropTargetEvent& event) { gfx::Point tab_strip_loc(event.location()); ConvertPointToView(this, tabstrip_, &tab_strip_loc); - return new ChromeViews::DropTargetEvent(event.GetData(), tab_strip_loc.x(), - tab_strip_loc.y(), - event.GetSourceOperations()); + return new views::DropTargetEvent(event.GetData(), tab_strip_loc.x(), + tab_strip_loc.y(), + event.GetSourceOperations()); } int BrowserView2::LayoutTabStrip() { @@ -972,7 +970,7 @@ void BrowserView2::LayoutStatusBubble(int top) { } bool BrowserView2::MaybeShowBookmarkBar(TabContents* contents) { - ChromeViews::View* new_bookmark_bar_view = NULL; + views::View* new_bookmark_bar_view = NULL; if (SupportsWindowFeature(FEATURE_BOOKMARKBAR) && contents) { new_bookmark_bar_view = GetBookmarkBarView(); if (!show_bookmark_bar_pref_.GetValue() && @@ -985,7 +983,7 @@ bool BrowserView2::MaybeShowBookmarkBar(TabContents* contents) { } bool BrowserView2::MaybeShowInfoBar(TabContents* contents) { - ChromeViews::View* new_info_bar = NULL; + views::View* new_info_bar = NULL; if (contents && contents->AsWebContents() && contents->AsWebContents()->view()->IsInfoBarVisible()) new_info_bar = contents->AsWebContents()->view()->GetInfoBarView(); @@ -993,7 +991,7 @@ bool BrowserView2::MaybeShowInfoBar(TabContents* contents) { } bool BrowserView2::MaybeShowDownloadShelf(TabContents* contents) { - ChromeViews::View* new_shelf = NULL; + views::View* new_shelf = NULL; if (contents && contents->IsDownloadShelfVisible()) new_shelf = contents->GetDownloadShelfView(); return UpdateChildViewAndLayout(new_shelf, &active_download_shelf_); @@ -1007,8 +1005,8 @@ void BrowserView2::UpdateUIForContents(TabContents* contents) { Layout(); } -bool BrowserView2::UpdateChildViewAndLayout(ChromeViews::View* new_view, - ChromeViews::View** old_view) { +bool BrowserView2::UpdateChildViewAndLayout(views::View* new_view, + views::View** old_view) { DCHECK(old_view); if (*old_view == new_view) { // The views haven't changed, if the views pref changed schedule a layout. @@ -1067,18 +1065,18 @@ void BrowserView2::LoadAccelerators() { ACCEL* accelerators = static_cast<ACCEL*>(malloc(sizeof(ACCEL) * count)); CopyAcceleratorTable(accelerator_table, accelerators, count); - ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(GetContainer()->GetHWND()); + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(GetContainer()->GetHWND()); DCHECK(focus_manager); // Let's build our own accelerator table. - accelerator_table_.reset(new std::map<ChromeViews::Accelerator, int>); + accelerator_table_.reset(new std::map<views::Accelerator, int>); for (int i = 0; i < count; ++i) { bool alt_down = (accelerators[i].fVirt & FALT) == FALT; bool ctrl_down = (accelerators[i].fVirt & FCONTROL) == FCONTROL; bool shift_down = (accelerators[i].fVirt & FSHIFT) == FSHIFT; - ChromeViews::Accelerator accelerator(accelerators[i].key, - shift_down, ctrl_down, alt_down); + views::Accelerator accelerator(accelerators[i].key, shift_down, ctrl_down, + alt_down); (*accelerator_table_)[accelerator] = accelerators[i].cmd; // Also register with the focus manager. diff --git a/chrome/browser/views/frame/browser_view2.h b/chrome/browser/views/frame/browser_view2.h index dbe4f5d..5dd812d 100644 --- a/chrome/browser/views/frame/browser_view2.h +++ b/chrome/browser/views/frame/browser_view2.h @@ -33,8 +33,8 @@ class TabContentsContainerView; class BrowserView2 : public BrowserWindow, public NotificationObserver, public TabStripModelObserver, - public ChromeViews::WindowDelegate, - public ChromeViews::ClientView { + public views::WindowDelegate, + public views::ClientView { public: explicit BrowserView2(Browser* browser); virtual ~BrowserView2(); @@ -72,13 +72,13 @@ class BrowserView2 : public BrowserWindow, bool ShouldShowOffTheRecordAvatar() const; // Handle the specified |accelerator| being pressed. - bool AcceleratorPressed(const ChromeViews::Accelerator& accelerator); + bool AcceleratorPressed(const views::Accelerator& accelerator); // Provides the containing frame with the accelerator for the specified // command id. This can be used to provide menu item shortcut hints etc. // Returns true if an accelerator was found for the specified |cmd_id|, false // otherwise. - bool GetAccelerator(int cmd_id, ChromeViews::Accelerator* accelerator); + bool GetAccelerator(int cmd_id, views::Accelerator* accelerator); // Handles incoming system messages. Returns true if the message was // handled. @@ -87,7 +87,7 @@ class BrowserView2 : public BrowserWindow, // Adds view to the set of views that drops are allowed to occur on. You only // need invoke this for views whose y-coordinate extends above the tab strip // and you want to allow drops on. - void AddViewToDropList(ChromeViews::View* view); + void AddViewToDropList(views::View* view); // Shows the next app-modal dialog box, if there is one to be shown, or moves // an existing showing one to the front. Returns true if one was shown or @@ -150,7 +150,7 @@ class BrowserView2 : public BrowserWindow, int frame_component); virtual void SizeToContents(const gfx::Rect& contents_bounds); virtual void SetAcceleratorTable( - std::map<ChromeViews::Accelerator, int>* accelerator_table); + std::map<views::Accelerator, int>* accelerator_table); virtual void ValidateThrobber(); virtual gfx::Rect GetNormalBounds(); virtual bool IsMaximized(); @@ -180,12 +180,12 @@ class BrowserView2 : public BrowserWindow, bool user_gesture); virtual void TabStripEmpty(); - // Overridden from ChromeViews::WindowDelegate: + // Overridden from views::WindowDelegate: virtual bool CanResize() const; virtual bool CanMaximize() const; virtual bool IsModal() const; virtual std::wstring GetWindowTitle() const; - virtual ChromeViews::View* GetInitiallyFocusedView() const; + virtual views::View* GetInitiallyFocusedView() const; virtual bool ShouldShowWindowTitle() const; virtual SkBitmap GetWindowIcon(); virtual bool ShouldShowWindowIcon() const; @@ -197,11 +197,10 @@ class BrowserView2 : public BrowserWindow, bool* maximized, bool* always_on_top); virtual void WindowClosing(); - virtual ChromeViews::View* GetContentsView(); - virtual ChromeViews::ClientView* CreateClientView( - ChromeViews::Window* window); + virtual views::View* GetContentsView(); + virtual views::ClientView* CreateClientView(views::Window* window); - // Overridden from ChromeViews::ClientView: + // Overridden from views::ClientView: virtual bool CanClose() const; virtual int NonClientHitTest(const gfx::Point& point); @@ -219,30 +218,29 @@ class BrowserView2 : public BrowserWindow, protected: - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual void Layout(); virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); // As long as ShouldForwardToTabStrip returns true, drag and drop methods // are forwarded to the tab strip. virtual bool CanDrop(const OSExchangeData& data); - 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); private: // Returns true if the event should be forwarded to the TabStrip. This // returns true if y coordinate is less than the bottom of the tab strip, and // is not over another child view. - virtual bool ShouldForwardToTabStrip( - const ChromeViews::DropTargetEvent& event); + virtual bool ShouldForwardToTabStrip(const views::DropTargetEvent& event); // Creates and returns a new DropTargetEvent in the coordinates of the // TabStrip. - ChromeViews::DropTargetEvent* MapEventToTabStrip( - const ChromeViews::DropTargetEvent& event); + views::DropTargetEvent* MapEventToTabStrip( + const views::DropTargetEvent& event); // Layout the TabStrip, returns the coordinate of the bottom of the TabStrip, // for laying out subsequent controls. @@ -291,8 +289,7 @@ class BrowserView2 : public BrowserWindow, // the new_view is added. This is intended to be used when swapping in/out // child views that are referenced via a field. // Returns true if anything was changed, and a re-Layout is now required. - bool UpdateChildViewAndLayout(ChromeViews::View* new_view, - ChromeViews::View** old_view); + bool UpdateChildViewAndLayout(views::View* new_view, views::View** old_view); // Copy the accelerator table from the app resources into something we can // use. @@ -314,9 +311,9 @@ class BrowserView2 : public BrowserWindow, scoped_ptr<Browser> browser_; // Tool/Info bars that we are currently showing. Used for layout. - ChromeViews::View* active_bookmark_bar_; - ChromeViews::View* active_info_bar_; - ChromeViews::View* active_download_shelf_; + views::View* active_bookmark_bar_; + views::View* active_info_bar_; + views::View* active_download_shelf_; // The TabStrip. TabStrip* tabstrip_; @@ -334,7 +331,7 @@ class BrowserView2 : public BrowserWindow, scoped_ptr<StatusBubble> status_bubble_; // A mapping between accelerators and commands. - scoped_ptr<std::map<ChromeViews::Accelerator, int>> accelerator_table_; + scoped_ptr<std::map<views::Accelerator, int>> accelerator_table_; // A PrefMember to track the "always show bookmark bar" pref. BooleanPrefMember show_bookmark_bar_pref_; @@ -357,7 +354,7 @@ class BrowserView2 : public BrowserWindow, bool forwarding_to_tab_strip_; // Set of additional views drops are allowed on. We do NOT own these. - std::set<ChromeViews::View*> dropable_views_; + std::set<views::View*> dropable_views_; // The OTR avatar image. static SkBitmap otr_avatar_; diff --git a/chrome/browser/views/frame/opaque_frame.cc b/chrome/browser/views/frame/opaque_frame.cc index 9bf52a3..8187d08 100644 --- a/chrome/browser/views/frame/opaque_frame.cc +++ b/chrome/browser/views/frame/opaque_frame.cc @@ -50,12 +50,12 @@ void OpaqueFrame::UpdateThrobber(bool running) { GetOpaqueNonClientView()->UpdateWindowIcon(); } -ChromeViews::Window* OpaqueFrame::GetWindow() { +views::Window* OpaqueFrame::GetWindow() { return this; } /////////////////////////////////////////////////////////////////////////////// -// OpaqueFrame, ChromeViews::CustomFrameWindow overrides: +// OpaqueFrame, views::CustomFrameWindow overrides: void OpaqueFrame::UpdateWindowIcon() { CustomFrameWindow::UpdateWindowIcon(); @@ -63,14 +63,13 @@ void OpaqueFrame::UpdateWindowIcon() { } /////////////////////////////////////////////////////////////////////////////// -// OpaqueFrame, ChromeViews::ContainerWin overrides: +// OpaqueFrame, views::ContainerWin overrides: -bool OpaqueFrame::AcceleratorPressed(ChromeViews::Accelerator* accelerator) { +bool OpaqueFrame::AcceleratorPressed(views::Accelerator* accelerator) { return browser_view_->AcceleratorPressed(*accelerator); } -bool OpaqueFrame::GetAccelerator(int cmd_id, - ChromeViews::Accelerator* accelerator) { +bool OpaqueFrame::GetAccelerator(int cmd_id, views::Accelerator* accelerator) { return browser_view_->GetAccelerator(cmd_id, accelerator); } diff --git a/chrome/browser/views/frame/opaque_frame.h b/chrome/browser/views/frame/opaque_frame.h index f40f1a8..fb531b0 100644 --- a/chrome/browser/views/frame/opaque_frame.h +++ b/chrome/browser/views/frame/opaque_frame.h @@ -9,7 +9,7 @@ #include "chrome/views/custom_frame_window.h" class BrowserView2; -namespace ChromeViews { +namespace views { class Window; } class OpaqueNonClientView; @@ -24,7 +24,7 @@ class TabStrip; // borders are provided with bitmaps. // class OpaqueFrame : public BrowserFrame, - public ChromeViews::CustomFrameWindow { + public views::CustomFrameWindow { public: explicit OpaqueFrame(BrowserView2* browser_view); virtual ~OpaqueFrame(); @@ -36,15 +36,14 @@ class OpaqueFrame : public BrowserFrame, virtual void SizeToContents(const gfx::Rect& contents_bounds); virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const; virtual void UpdateThrobber(bool running); - virtual ChromeViews::Window* GetWindow(); + virtual views::Window* GetWindow(); - // Overridden from ChromeViews::CustomFrameWindow: + // Overridden from views::CustomFrameWindow: virtual void UpdateWindowIcon(); - // Overridden from ChromeViews::ContainerWin: - virtual bool AcceleratorPressed(ChromeViews::Accelerator* accelerator); - virtual bool GetAccelerator(int cmd_id, - ChromeViews::Accelerator* accelerator); + // Overridden from views::ContainerWin: + virtual bool AcceleratorPressed(views::Accelerator* accelerator); + virtual bool GetAccelerator(int cmd_id, views::Accelerator* accelerator); virtual void OnEndSession(BOOL ending, UINT logoff); virtual void OnExitMenuLoop(bool is_track_popup_menu); virtual void OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu); diff --git a/chrome/browser/views/frame/opaque_non_client_view.cc b/chrome/browser/views/frame/opaque_non_client_view.cc index ac29c56..9c2c174 100644 --- a/chrome/browser/views/frame/opaque_non_client_view.cc +++ b/chrome/browser/views/frame/opaque_non_client_view.cc @@ -65,7 +65,7 @@ enum { FRAME_PART_BITMAP_COUNT // Must be last. }; -class ActiveWindowResources : public WindowResources { +class ActiveWindowResources : public views::WindowResources { public: ActiveWindowResources() { InitClass(); @@ -73,7 +73,7 @@ class ActiveWindowResources : public WindowResources { virtual ~ActiveWindowResources() { } // WindowResources implementation: - virtual SkBitmap* GetPartBitmap(FramePartBitmap part) const { + virtual SkBitmap* GetPartBitmap(views::FramePartBitmap part) const { return standard_frame_bitmaps_[part]; } @@ -116,7 +116,7 @@ class ActiveWindowResources : public WindowResources { DISALLOW_EVIL_CONSTRUCTORS(ActiveWindowResources); }; -class InactiveWindowResources : public WindowResources { +class InactiveWindowResources : public views::WindowResources { public: InactiveWindowResources() { InitClass(); @@ -124,7 +124,7 @@ class InactiveWindowResources : public WindowResources { virtual ~InactiveWindowResources() { } // WindowResources implementation: - virtual SkBitmap* GetPartBitmap(FramePartBitmap part) const { + virtual SkBitmap* GetPartBitmap(views::FramePartBitmap part) const { return standard_frame_bitmaps_[part]; } @@ -167,7 +167,7 @@ class InactiveWindowResources : public WindowResources { DISALLOW_EVIL_CONSTRUCTORS(InactiveWindowResources); }; -class OTRActiveWindowResources : public WindowResources { +class OTRActiveWindowResources : public views::WindowResources { public: OTRActiveWindowResources() { InitClass(); @@ -175,7 +175,7 @@ class OTRActiveWindowResources : public WindowResources { virtual ~OTRActiveWindowResources() { } // WindowResources implementation: - virtual SkBitmap* GetPartBitmap(FramePartBitmap part) const { + virtual SkBitmap* GetPartBitmap(views::FramePartBitmap part) const { return standard_frame_bitmaps_[part]; } @@ -217,7 +217,7 @@ class OTRActiveWindowResources : public WindowResources { DISALLOW_EVIL_CONSTRUCTORS(OTRActiveWindowResources); }; -class OTRInactiveWindowResources : public WindowResources { +class OTRInactiveWindowResources : public views::WindowResources { public: OTRInactiveWindowResources() { InitClass(); @@ -225,7 +225,7 @@ class OTRInactiveWindowResources : public WindowResources { virtual ~OTRInactiveWindowResources() { } // WindowResources implementation: - virtual SkBitmap* GetPartBitmap(FramePartBitmap part) const { + virtual SkBitmap* GetPartBitmap(views::FramePartBitmap part) const { return standard_frame_bitmaps_[part]; } @@ -274,10 +274,10 @@ SkBitmap* InactiveWindowResources::standard_frame_bitmaps_[]; SkBitmap* OTRActiveWindowResources::standard_frame_bitmaps_[]; SkBitmap* OTRInactiveWindowResources::standard_frame_bitmaps_[]; -WindowResources* OpaqueNonClientView::active_resources_ = NULL; -WindowResources* OpaqueNonClientView::inactive_resources_ = NULL; -WindowResources* OpaqueNonClientView::active_otr_resources_ = NULL; -WindowResources* OpaqueNonClientView::inactive_otr_resources_ = NULL; +views::WindowResources* OpaqueNonClientView::active_resources_ = NULL; +views::WindowResources* OpaqueNonClientView::inactive_resources_ = NULL; +views::WindowResources* OpaqueNonClientView::active_otr_resources_ = NULL; +views::WindowResources* OpaqueNonClientView::inactive_otr_resources_ = NULL; SkBitmap OpaqueNonClientView::distributor_logo_; SkBitmap OpaqueNonClientView::app_top_left_; SkBitmap OpaqueNonClientView::app_top_center_; @@ -357,10 +357,10 @@ static const int kNewTabIconWindowControlsSpacing = 10; OpaqueNonClientView::OpaqueNonClientView(OpaqueFrame* frame, BrowserView2* browser_view) : NonClientView(), - minimize_button_(new ChromeViews::Button), - maximize_button_(new ChromeViews::Button), - restore_button_(new ChromeViews::Button), - close_button_(new ChromeViews::Button), + minimize_button_(new views::Button), + maximize_button_(new views::Button), + restore_button_(new views::Button), + close_button_(new views::Button), window_icon_(NULL), frame_(frame), browser_view_(browser_view) { @@ -378,15 +378,15 @@ OpaqueNonClientView::OpaqueNonClientView(OpaqueFrame* frame, current_inactive_resources_ = inactive_resources_; } - WindowResources* resources = current_active_resources_; + views::WindowResources* resources = current_active_resources_; minimize_button_->SetImage( - ChromeViews::Button::BS_NORMAL, + views::Button::BS_NORMAL, resources->GetPartBitmap(FRAME_MINIMIZE_BUTTON_ICON)); minimize_button_->SetImage( - ChromeViews::Button::BS_HOT, + views::Button::BS_HOT, resources->GetPartBitmap(FRAME_MINIMIZE_BUTTON_ICON_H)); minimize_button_->SetImage( - ChromeViews::Button::BS_PUSHED, + views::Button::BS_PUSHED, resources->GetPartBitmap(FRAME_MINIMIZE_BUTTON_ICON_P)); minimize_button_->SetListener(this, -1); minimize_button_->SetAccessibleName( @@ -394,13 +394,13 @@ OpaqueNonClientView::OpaqueNonClientView(OpaqueFrame* frame, AddChildView(minimize_button_); maximize_button_->SetImage( - ChromeViews::Button::BS_NORMAL, + views::Button::BS_NORMAL, resources->GetPartBitmap(FRAME_MAXIMIZE_BUTTON_ICON)); maximize_button_->SetImage( - ChromeViews::Button::BS_HOT, + views::Button::BS_HOT, resources->GetPartBitmap(FRAME_MAXIMIZE_BUTTON_ICON_H)); maximize_button_->SetImage( - ChromeViews::Button::BS_PUSHED, + views::Button::BS_PUSHED, resources->GetPartBitmap(FRAME_MAXIMIZE_BUTTON_ICON_P)); maximize_button_->SetListener(this, -1); maximize_button_->SetAccessibleName( @@ -408,13 +408,13 @@ OpaqueNonClientView::OpaqueNonClientView(OpaqueFrame* frame, AddChildView(maximize_button_); restore_button_->SetImage( - ChromeViews::Button::BS_NORMAL, + views::Button::BS_NORMAL, resources->GetPartBitmap(FRAME_RESTORE_BUTTON_ICON)); restore_button_->SetImage( - ChromeViews::Button::BS_HOT, + views::Button::BS_HOT, resources->GetPartBitmap(FRAME_RESTORE_BUTTON_ICON_H)); restore_button_->SetImage( - ChromeViews::Button::BS_PUSHED, + views::Button::BS_PUSHED, resources->GetPartBitmap(FRAME_RESTORE_BUTTON_ICON_P)); restore_button_->SetListener(this, -1); restore_button_->SetAccessibleName( @@ -422,13 +422,13 @@ OpaqueNonClientView::OpaqueNonClientView(OpaqueFrame* frame, AddChildView(restore_button_); close_button_->SetImage( - ChromeViews::Button::BS_NORMAL, + views::Button::BS_NORMAL, resources->GetPartBitmap(FRAME_CLOSE_BUTTON_ICON)); close_button_->SetImage( - ChromeViews::Button::BS_HOT, + views::Button::BS_HOT, resources->GetPartBitmap(FRAME_CLOSE_BUTTON_ICON_H)); close_button_->SetImage( - ChromeViews::Button::BS_PUSHED, + views::Button::BS_PUSHED, resources->GetPartBitmap(FRAME_CLOSE_BUTTON_ICON_P)); close_button_->SetListener(this, -1); close_button_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_CLOSE)); @@ -487,9 +487,9 @@ SkBitmap OpaqueNonClientView::GetFavIcon() { } /////////////////////////////////////////////////////////////////////////////// -// OpaqueNonClientView, ChromeViews::BaseButton::ButtonListener implementation: +// OpaqueNonClientView, views::BaseButton::ButtonListener implementation: -void OpaqueNonClientView::ButtonPressed(ChromeViews::BaseButton* sender) { +void OpaqueNonClientView::ButtonPressed(views::BaseButton* sender) { if (sender == minimize_button_) { frame_->ExecuteSystemMenuCommand(SC_MINIMIZE); } else if (sender == maximize_button_) { @@ -502,7 +502,7 @@ void OpaqueNonClientView::ButtonPressed(ChromeViews::BaseButton* sender) { } /////////////////////////////////////////////////////////////////////////////// -// OpaqueNonClientView, ChromeViews::NonClientView implementation: +// OpaqueNonClientView, views::NonClientView implementation: gfx::Rect OpaqueNonClientView::CalculateClientAreaBounds(int width, int height) const { @@ -593,7 +593,7 @@ void OpaqueNonClientView::EnableClose(bool enable) { } /////////////////////////////////////////////////////////////////////////////// -// OpaqueNonClientView, ChromeViews::View overrides: +// OpaqueNonClientView, views::View overrides: void OpaqueNonClientView::Paint(ChromeCanvas* canvas) { // Clip the content area out of the rendering. @@ -634,14 +634,13 @@ gfx::Size OpaqueNonClientView::GetPreferredSize() { return prefsize; } -ChromeViews::View* OpaqueNonClientView::GetViewForPoint( - const gfx::Point& point, - bool can_create_floating) { +views::View* OpaqueNonClientView::GetViewForPoint(const gfx::Point& point, + bool can_create_floating) { // We override this function because the ClientView can overlap the non - // client view, making it impossible to click on the window controls. We need // to ensure the window controls are checked _first_. - ChromeViews::View* views[] = { close_button_, restore_button_, - maximize_button_, minimize_button_ }; + views::View* views[] = { close_button_, restore_button_, maximize_button_, + minimize_button_ }; for (int i = 0; i < arraysize(views); ++i) { if (!views[i]->IsVisible()) continue; @@ -652,8 +651,8 @@ ChromeViews::View* OpaqueNonClientView::GetViewForPoint( } void OpaqueNonClientView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (is_add && child == this) { DCHECK(GetContainer()); DCHECK(frame_->client_view()->GetParent() != this); @@ -776,7 +775,7 @@ void OpaqueNonClientView::PaintDistributorLogo(ChromeCanvas* canvas) { void OpaqueNonClientView::PaintTitleBar(ChromeCanvas* canvas) { // The window icon is painted by the TabIconView. - ChromeViews::WindowDelegate* d = frame_->window_delegate(); + views::WindowDelegate* d = frame_->window_delegate(); if (d->ShouldShowWindowTitle()) { int title_x = MirroredLeftPointForRect(title_bounds_); canvas->DrawStringInt(d->GetWindowTitle(), title_font_, SK_ColorWHITE, @@ -879,50 +878,50 @@ void OpaqueNonClientView::LayoutWindowControls() { if (frame_->IsMaximized()) { ps = close_button_->GetPreferredSize(); - close_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_TOP); + close_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_TOP); close_button_->SetBounds( width() - ps.width() - kWindowControlsRightZoomedOffset, 0, ps.width() + kWindowControlsRightZoomedOffset, ps.height() + kWindowControlsTopZoomedOffset); ps = restore_button_->GetPreferredSize(); - restore_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_TOP); + restore_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_TOP); restore_button_->SetBounds(close_button_->x() - ps.width(), 0, ps.width(), ps.height() + kWindowControlsTopZoomedOffset); ps = minimize_button_->GetPreferredSize(); - minimize_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_TOP); + minimize_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_TOP); minimize_button_->SetBounds(restore_button_->x() - ps.width(), 0, ps.width(), ps.height() + kWindowControlsTopZoomedOffset); } else if (frame_->IsMinimized()) { ps = close_button_->GetPreferredSize(); - close_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_BOTTOM); + close_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_BOTTOM); close_button_->SetBounds( width() - ps.width() - kWindowControlsRightZoomedOffset, 0, ps.width() + kWindowControlsRightZoomedOffset, ps.height() + kWindowControlsTopZoomedOffset); ps = restore_button_->GetPreferredSize(); - restore_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_BOTTOM); + restore_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_BOTTOM); restore_button_->SetBounds(close_button_->x() - ps.width(), 0, ps.width(), ps.height() + kWindowControlsTopZoomedOffset); ps = minimize_button_->GetPreferredSize(); - minimize_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_BOTTOM); + minimize_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_BOTTOM); minimize_button_->SetBounds(restore_button_->x() - ps.width(), 0, ps.width(), ps.height() + kWindowControlsTopZoomedOffset); } else { ps = close_button_->GetPreferredSize(); - close_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_TOP); + close_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_TOP); close_button_->SetBounds(width() - kWindowControlsRightOffset - ps.width(), kWindowControlsTopOffset, ps.width(), ps.height()); @@ -931,15 +930,15 @@ void OpaqueNonClientView::LayoutWindowControls() { maximize_button_->SetVisible(true); ps = maximize_button_->GetPreferredSize(); - maximize_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_TOP); + maximize_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_TOP); maximize_button_->SetBounds(close_button_->x() - ps.width(), kWindowControlsTopOffset, ps.width(), ps.height()); ps = minimize_button_->GetPreferredSize(); - minimize_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_TOP); + minimize_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_TOP); minimize_button_->SetBounds(maximize_button_->x() - ps.width(), kWindowControlsTopOffset, ps.width(), ps.height()); @@ -974,7 +973,7 @@ void OpaqueNonClientView::LayoutDistributorLogo() { void OpaqueNonClientView::LayoutTitleBar() { int top_offset = frame_->IsMaximized() ? kWindowTopMarginZoomed : 0; - ChromeViews::WindowDelegate* d = frame_->window_delegate(); + views::WindowDelegate* d = frame_->window_delegate(); // Size the window icon, even if it is hidden so we can size the title based // on its position. diff --git a/chrome/browser/views/frame/opaque_non_client_view.h b/chrome/browser/views/frame/opaque_non_client_view.h index 830ba76..3063b11 100644 --- a/chrome/browser/views/frame/opaque_non_client_view.h +++ b/chrome/browser/views/frame/opaque_non_client_view.h @@ -14,10 +14,12 @@ class BrowserView2; class OpaqueFrame; class TabContents; class TabStrip; +namespace views { class WindowResources; +} -class OpaqueNonClientView : public ChromeViews::NonClientView, - public ChromeViews::BaseButton::ButtonListener, +class OpaqueNonClientView : public views::NonClientView, + public views::BaseButton::ButtonListener, public TabIconView::TabContentsProvider { public: // Constructs a non-client view for an OpaqueFrame. |is_otr| specifies if the @@ -41,10 +43,10 @@ class OpaqueNonClientView : public ChromeViews::NonClientView, virtual TabContents* GetCurrentTabContents(); virtual SkBitmap GetFavIcon(); - // Overridden from ChromeViews::BaseButton::ButtonListener: - virtual void ButtonPressed(ChromeViews::BaseButton* sender); + // Overridden from views::BaseButton::ButtonListener: + virtual void ButtonPressed(views::BaseButton* sender); - // Overridden from ChromeViews::NonClientView: + // Overridden from views::NonClientView: virtual gfx::Rect CalculateClientAreaBounds(int width, int height) const; virtual gfx::Size CalculateWindowSizeForClientSize(int width, int height) const; @@ -53,15 +55,15 @@ class OpaqueNonClientView : public ChromeViews::NonClientView, virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); virtual void EnableClose(bool enable); - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual void Paint(ChromeCanvas* canvas); virtual void Layout(); virtual gfx::Size GetPreferredSize(); - virtual ChromeViews::View* GetViewForPoint(const gfx::Point& point, - bool can_create_floating); + virtual views::View* GetViewForPoint(const gfx::Point& point, + bool can_create_floating); virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); virtual bool GetAccessibleRole(VARIANT* role); virtual bool GetAccessibleName(std::wstring* name); virtual void SetAccessibleName(const std::wstring& name); @@ -91,7 +93,7 @@ class OpaqueNonClientView : public ChromeViews::NonClientView, void LayoutClientView(); // Returns the set of resources to use to paint this view. - WindowResources* resources() const { + views::WindowResources* resources() const { return frame_->is_active() || paint_as_active() ? current_active_resources_ : current_inactive_resources_; } @@ -109,10 +111,10 @@ class OpaqueNonClientView : public ChromeViews::NonClientView, gfx::Rect otr_avatar_bounds_; // Window controls. - ChromeViews::Button* minimize_button_; - ChromeViews::Button* maximize_button_; - ChromeViews::Button* restore_button_; - ChromeViews::Button* close_button_; + views::Button* minimize_button_; + views::Button* maximize_button_; + views::Button* restore_button_; + views::Button* close_button_; // The Window icon. TabIconView* window_icon_; @@ -124,8 +126,8 @@ class OpaqueNonClientView : public ChromeViews::NonClientView, BrowserView2* browser_view_; // The resources currently used to paint this view. - WindowResources* current_active_resources_; - WindowResources* current_inactive_resources_; + views::WindowResources* current_active_resources_; + views::WindowResources* current_inactive_resources_; // The accessible name of this view. std::wstring accessible_name_; @@ -136,10 +138,10 @@ class OpaqueNonClientView : public ChromeViews::NonClientView, static SkBitmap app_top_left_; static SkBitmap app_top_center_; static SkBitmap app_top_right_; - static WindowResources* active_resources_; - static WindowResources* inactive_resources_; - static WindowResources* active_otr_resources_; - static WindowResources* inactive_otr_resources_; + static views::WindowResources* active_resources_; + static views::WindowResources* inactive_resources_; + static views::WindowResources* active_otr_resources_; + static views::WindowResources* inactive_otr_resources_; static ChromeFont title_font_; DISALLOW_EVIL_CONSTRUCTORS(OpaqueNonClientView); |