diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-09 19:24:48 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-09 19:24:48 +0000 |
commit | a8a6012b1346f64cec04ce8f4ca592cdae77ec2d (patch) | |
tree | 43fea13d2183846b977dedd9606335f7f4283d94 /chrome | |
parent | 6faf7b1cc2d797140afd3df1211685307488cfcf (diff) | |
download | chromium_src-a8a6012b1346f64cec04ce8f4ca592cdae77ec2d.zip chromium_src-a8a6012b1346f64cec04ce8f4ca592cdae77ec2d.tar.gz chromium_src-a8a6012b1346f64cec04ce8f4ca592cdae77ec2d.tar.bz2 |
Consolidate more into Window:
- inactive rendering disabling tracking
- window icon updating
BUG=72040
TEST=none
Review URL: http://codereview.chromium.org/6650031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77497 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
11 files changed, 113 insertions, 83 deletions
diff --git a/chrome/browser/chromeos/frame/browser_frame_chromeos.cc b/chrome/browser/chromeos/frame/browser_frame_chromeos.cc index b32d5fb..2224068 100644 --- a/chrome/browser/chromeos/frame/browser_frame_chromeos.cc +++ b/chrome/browser/chromeos/frame/browser_frame_chromeos.cc @@ -38,7 +38,7 @@ void BrowserFrameChromeos::InitBrowserFrame() { if (!browser_view()->IsBrowserTypePopup()) { // On chromeos we want windows to always render as active. - non_client_view()->DisableInactiveRendering(true); + DisableInactiveRendering(); } } diff --git a/chrome/browser/chromeos/frame/bubble_frame_view.cc b/chrome/browser/chromeos/frame/bubble_frame_view.cc index d49d001..37acb39 100644 --- a/chrome/browser/chromeos/frame/bubble_frame_view.cc +++ b/chrome/browser/chromeos/frame/bubble_frame_view.cc @@ -137,6 +137,9 @@ void BubbleFrameView::EnableClose(bool enable) { void BubbleFrameView::ResetWindowControls() { } +void BubbleFrameView::UpdateWindowIcon() { +} + gfx::Insets BubbleFrameView::GetInsets() const { gfx::Insets border_insets; border()->GetInsets(&border_insets); diff --git a/chrome/browser/chromeos/frame/bubble_frame_view.h b/chrome/browser/chromeos/frame/bubble_frame_view.h index 1c017f3..1aa72d5 100644 --- a/chrome/browser/chromeos/frame/bubble_frame_view.h +++ b/chrome/browser/chromeos/frame/bubble_frame_view.h @@ -34,23 +34,25 @@ class BubbleFrameView : public views::NonClientFrameView, virtual ~BubbleFrameView(); // Overridden from views::NonClientFrameView: - virtual gfx::Rect GetBoundsForClientView() const; + virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; virtual gfx::Rect GetWindowBoundsForClientBounds( - const gfx::Rect& client_bounds) const; - virtual int NonClientHitTest(const gfx::Point& point); - virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); - virtual void EnableClose(bool enable); - virtual void ResetWindowControls(); + const gfx::Rect& client_bounds) const OVERRIDE; + virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; + virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) + OVERRIDE; + virtual void EnableClose(bool enable) OVERRIDE; + virtual void ResetWindowControls() OVERRIDE; + virtual void UpdateWindowIcon() OVERRIDE; // View overrides: - virtual gfx::Insets GetInsets() const; - virtual gfx::Size GetPreferredSize(); - virtual void Layout(); - virtual void OnPaint(gfx::Canvas* canvas); + virtual gfx::Insets GetInsets() const OVERRIDE; + virtual gfx::Size GetPreferredSize() OVERRIDE; + virtual void Layout() OVERRIDE; + virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; // Overridden from views::ButtonListener: - virtual void ButtonPressed(views::Button* sender, - const views::Event& event); + virtual void ButtonPressed(views::Button* sender, const views::Event& event) + OVERRIDE; void StartThrobber(); void StopThrobber(); diff --git a/chrome/browser/ui/views/constrained_window_win.cc b/chrome/browser/ui/views/constrained_window_win.cc index 7beb018..78e388b 100644 --- a/chrome/browser/ui/views/constrained_window_win.cc +++ b/chrome/browser/ui/views/constrained_window_win.cc @@ -148,22 +148,25 @@ class ConstrainedWindowFrameView void UpdateWindowTitle(); // Overridden from views::NonClientFrameView: - virtual gfx::Rect GetBoundsForClientView() const; - virtual bool AlwaysUseCustomFrame() const; + virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; + virtual bool AlwaysUseCustomFrame() const OVERRIDE; virtual gfx::Rect GetWindowBoundsForClientBounds( - const gfx::Rect& client_bounds) const; - virtual int NonClientHitTest(const gfx::Point& point); - virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); - virtual void EnableClose(bool enable); - virtual void ResetWindowControls() { } + const gfx::Rect& client_bounds) const OVERRIDE; + virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; + virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) + OVERRIDE; + virtual void EnableClose(bool enable) OVERRIDE; + virtual void ResetWindowControls() OVERRIDE {} + virtual void UpdateWindowIcon() OVERRIDE {} // Overridden from views::View: - virtual void OnPaint(gfx::Canvas* canvas); - virtual void Layout(); - virtual void OnThemeChanged(); + virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; + virtual void Layout() OVERRIDE; + virtual void OnThemeChanged() OVERRIDE; // Overridden from views::ButtonListener: - virtual void ButtonPressed(views::Button* sender, const views::Event& event); + virtual void ButtonPressed(views::Button* sender, const views::Event& event) + OVERRIDE; private: // Returns the thickness of the entire nonclient left, right, and bottom diff --git a/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc b/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc index 40fa89d..631d4ba 100644 --- a/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc @@ -210,6 +210,11 @@ void AppPanelBrowserFrameView::ResetWindowControls() { // The close button isn't affected by this constraint. } +void AppPanelBrowserFrameView::UpdateWindowIcon() { + window_icon_->SchedulePaint(); +} + + /////////////////////////////////////////////////////////////////////////////// // AppPanelBrowserFrameView, views::View overrides: diff --git a/chrome/browser/ui/views/frame/app_panel_browser_frame_view.h b/chrome/browser/ui/views/frame/app_panel_browser_frame_view.h index b1ba9a2..2396390 100644 --- a/chrome/browser/ui/views/frame/app_panel_browser_frame_view.h +++ b/chrome/browser/ui/views/frame/app_panel_browser_frame_view.h @@ -33,33 +33,36 @@ class AppPanelBrowserFrameView : public BrowserNonClientFrameView, virtual ~AppPanelBrowserFrameView(); // Overridden from BrowserNonClientFrameView: - virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const; - virtual int GetHorizontalTabStripVerticalOffset(bool restored) const; - virtual void UpdateThrobber(bool running); - virtual gfx::Size GetMinimumSize(); + virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const OVERRIDE; + virtual int GetHorizontalTabStripVerticalOffset(bool restored) const OVERRIDE; + virtual void UpdateThrobber(bool running) OVERRIDE; + virtual gfx::Size GetMinimumSize() OVERRIDE; protected: // Overridden from views::NonClientFrameView: - virtual gfx::Rect GetBoundsForClientView() const; - virtual bool AlwaysUseCustomFrame() const; - virtual bool AlwaysUseNativeFrame() const; + virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; + virtual bool AlwaysUseCustomFrame() const OVERRIDE; + virtual bool AlwaysUseNativeFrame() const OVERRIDE; virtual gfx::Rect GetWindowBoundsForClientBounds( - const gfx::Rect& client_bounds) const; - virtual int NonClientHitTest(const gfx::Point& point); - virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); - virtual void EnableClose(bool enable); - virtual void ResetWindowControls(); + const gfx::Rect& client_bounds) const OVERRIDE; + virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; + virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) + OVERRIDE; + virtual void EnableClose(bool enable) OVERRIDE; + virtual void ResetWindowControls() OVERRIDE; + virtual void UpdateWindowIcon() OVERRIDE; // Overridden from views::View: - virtual void OnPaint(gfx::Canvas* canvas); - virtual void Layout(); + virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; + virtual void Layout() OVERRIDE; // Overridden from views::ButtonListener: - virtual void ButtonPressed(views::Button* sender, const views::Event& event); + virtual void ButtonPressed(views::Button* sender, const views::Event& event) + OVERRIDE; // Overridden from TabIconView::TabIconViewModel: - virtual bool ShouldTabIconViewAnimate() const; - virtual SkBitmap GetFavIconForTabIconView(); + virtual bool ShouldTabIconViewAnimate() const OVERRIDE; + virtual SkBitmap GetFavIconForTabIconView() OVERRIDE; private: // Returns the thickness of the border that makes up the window frame edges. diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.h b/chrome/browser/ui/views/frame/glass_browser_frame_view.h index 937012d..22f96c1 100644 --- a/chrome/browser/ui/views/frame/glass_browser_frame_view.h +++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.h @@ -32,27 +32,29 @@ class GlassBrowserFrameView : public BrowserNonClientFrameView, virtual ~GlassBrowserFrameView(); // Overridden from BrowserNonClientFrameView: - virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const; - virtual int GetHorizontalTabStripVerticalOffset(bool restored) const; - virtual void UpdateThrobber(bool running); + virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const OVERRIDE; + virtual int GetHorizontalTabStripVerticalOffset(bool restored) const OVERRIDE; + virtual void UpdateThrobber(bool running) OVERRIDE; // Overridden from views::NonClientFrameView: - virtual gfx::Rect GetBoundsForClientView() const; - virtual bool AlwaysUseNativeFrame() const; + virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; + virtual bool AlwaysUseNativeFrame() const OVERRIDE; virtual gfx::Rect GetWindowBoundsForClientBounds( - const gfx::Rect& client_bounds) const; - virtual int NonClientHitTest(const gfx::Point& point); - virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) { } - virtual void EnableClose(bool enable) { } - virtual void ResetWindowControls() { } + const gfx::Rect& client_bounds) const OVERRIDE; + virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; + virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) + OVERRIDE { } + virtual void EnableClose(bool enable) OVERRIDE { } + virtual void ResetWindowControls() OVERRIDE { } + virtual void UpdateWindowIcon() OVERRIDE { } // views::ViewMenuDelegate implementation: virtual void RunMenu(views::View* source, const gfx::Point& pt) OVERRIDE; protected: // Overridden from views::View: - virtual void OnPaint(gfx::Canvas* canvas); - virtual void Layout(); + virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; + virtual void Layout() OVERRIDE; private: // Returns the thickness of the border that makes up the window frame edges. diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc index 8501d29..2622b03 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc @@ -346,6 +346,10 @@ void OpaqueBrowserFrameView::ResetWindowControls() { // The close button isn't affected by this constraint. } +void OpaqueBrowserFrameView::UpdateWindowIcon() { + window_icon_->SchedulePaint(); +} + /////////////////////////////////////////////////////////////////////////////// // OpaqueBrowserFrameView, views::View overrides: diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.h b/chrome/browser/ui/views/frame/opaque_browser_frame_view.h index 0303d3a..297c08f 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.h +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.h @@ -31,10 +31,10 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView, virtual ~OpaqueBrowserFrameView(); // Overridden from BrowserNonClientFrameView: - virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const; - virtual int GetHorizontalTabStripVerticalOffset(bool restored) const; - virtual void UpdateThrobber(bool running); - virtual gfx::Size GetMinimumSize(); + virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const OVERRIDE; + virtual int GetHorizontalTabStripVerticalOffset(bool restored) const OVERRIDE; + virtual void UpdateThrobber(bool running) OVERRIDE; + virtual gfx::Size GetMinimumSize() OVERRIDE; protected: BrowserView* browser_view() const { return browser_view_; } @@ -45,28 +45,31 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView, virtual gfx::Rect GetBoundsForReservedArea() const; // Overridden from views::NonClientFrameView: - virtual gfx::Rect GetBoundsForClientView() const; - virtual bool AlwaysUseNativeFrame() const; - virtual bool AlwaysUseCustomFrame() const; + virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; + virtual bool AlwaysUseNativeFrame() const OVERRIDE; + virtual bool AlwaysUseCustomFrame() const OVERRIDE; virtual gfx::Rect GetWindowBoundsForClientBounds( - const gfx::Rect& client_bounds) const; - virtual int NonClientHitTest(const gfx::Point& point); - virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); - virtual void EnableClose(bool enable); - virtual void ResetWindowControls(); + const gfx::Rect& client_bounds) const OVERRIDE; + virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; + virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) + OVERRIDE; + virtual void EnableClose(bool enable) OVERRIDE; + virtual void ResetWindowControls() OVERRIDE; + virtual void UpdateWindowIcon() OVERRIDE; // Overridden from views::View: - virtual void OnPaint(gfx::Canvas* canvas); - virtual void Layout(); - virtual bool HitTest(const gfx::Point& l) const; - virtual AccessibilityTypes::Role GetAccessibleRole(); + virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; + virtual void Layout() OVERRIDE; + virtual bool HitTest(const gfx::Point& l) const OVERRIDE; + virtual AccessibilityTypes::Role GetAccessibleRole() OVERRIDE; // Overridden from views::ButtonListener: - virtual void ButtonPressed(views::Button* sender, const views::Event& event); + virtual void ButtonPressed(views::Button* sender, const views::Event& event) + OVERRIDE; // Overridden from TabIconView::TabIconViewModel: - virtual bool ShouldTabIconViewAnimate() const; - virtual SkBitmap GetFavIconForTabIconView(); + virtual bool ShouldTabIconViewAnimate() const OVERRIDE; + virtual SkBitmap GetFavIconForTabIconView() OVERRIDE; private: // Returns the thickness of the border that makes up the window frame edges. diff --git a/chrome/browser/ui/views/frame/popup_non_client_frame_view.cc b/chrome/browser/ui/views/frame/popup_non_client_frame_view.cc index bb9af66..0475dcd 100644 --- a/chrome/browser/ui/views/frame/popup_non_client_frame_view.cc +++ b/chrome/browser/ui/views/frame/popup_non_client_frame_view.cc @@ -43,6 +43,9 @@ void PopupNonClientFrameView::EnableClose(bool enable) { void PopupNonClientFrameView::ResetWindowControls() { } +void PopupNonClientFrameView::UpdateWindowIcon() { +} + gfx::Rect PopupNonClientFrameView::GetBoundsForTabStrip( views::View* tabstrip) const { return gfx::Rect(0, 0, width(), tabstrip->GetPreferredSize().height()); diff --git a/chrome/browser/ui/views/frame/popup_non_client_frame_view.h b/chrome/browser/ui/views/frame/popup_non_client_frame_view.h index 891d1a2..abd4875 100644 --- a/chrome/browser/ui/views/frame/popup_non_client_frame_view.h +++ b/chrome/browser/ui/views/frame/popup_non_client_frame_view.h @@ -16,20 +16,22 @@ class PopupNonClientFrameView : public BrowserNonClientFrameView { PopupNonClientFrameView() {} // NonClientFrameView: - virtual gfx::Rect GetBoundsForClientView() const; - virtual bool AlwaysUseCustomFrame() const; - virtual bool AlwaysUseNativeFrame() const; + virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; + virtual bool AlwaysUseCustomFrame() const OVERRIDE; + virtual bool AlwaysUseNativeFrame() const OVERRIDE; virtual gfx::Rect GetWindowBoundsForClientBounds( - const gfx::Rect& client_bounds) const; - virtual int NonClientHitTest(const gfx::Point& point); - virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); - virtual void EnableClose(bool enable); - virtual void ResetWindowControls(); + const gfx::Rect& client_bounds) const OVERRIDE; + virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; + virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) + OVERRIDE; + virtual void EnableClose(bool enable) OVERRIDE; + virtual void ResetWindowControls() OVERRIDE; + virtual void UpdateWindowIcon() OVERRIDE; // BrowserNonClientFrameView: - virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const; - virtual int GetHorizontalTabStripVerticalOffset(bool restored) const; - virtual void UpdateThrobber(bool running); + virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const OVERRIDE; + virtual int GetHorizontalTabStripVerticalOffset(bool restored) const OVERRIDE; + virtual void UpdateThrobber(bool running) OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(PopupNonClientFrameView); |