| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/ui/views/frame/browser_frame.h" | 9 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| 10 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" | 10 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" |
| 11 #include "chrome/browser/ui/views/tab_icon_view.h" | 11 #include "chrome/browser/ui/views/tab_icon_view_model.h" |
| 12 #include "content/public/browser/notification_observer.h" | 12 #include "content/public/browser/notification_observer.h" |
| 13 #include "content/public/browser/notification_registrar.h" | 13 #include "content/public/browser/notification_registrar.h" |
| 14 #include "ui/views/controls/button/button.h" | 14 #include "ui/views/controls/button/button.h" |
| 15 #include "ui/views/window/non_client_view.h" | 15 #include "ui/views/window/non_client_view.h" |
| 16 | 16 |
| 17 class BrowserView; | 17 class BrowserView; |
| 18 class TabIconView; |
| 19 |
| 18 namespace views { | 20 namespace views { |
| 19 class ImageButton; | 21 class ImageButton; |
| 20 class FrameBackground; | 22 class FrameBackground; |
| 21 } | 23 } |
| 22 | 24 |
| 23 class OpaqueBrowserFrameView : public BrowserNonClientFrameView, | 25 class OpaqueBrowserFrameView : public BrowserNonClientFrameView, |
| 24 public content::NotificationObserver, | 26 public content::NotificationObserver, |
| 25 public views::ButtonListener, | 27 public views::ButtonListener, |
| 26 public TabIconView::TabIconViewModel { | 28 public chrome::TabIconViewModel { |
| 27 public: | 29 public: |
| 28 // Constructs a non-client view for an BrowserFrame. | 30 // Constructs a non-client view for an BrowserFrame. |
| 29 OpaqueBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); | 31 OpaqueBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); |
| 30 virtual ~OpaqueBrowserFrameView(); | 32 virtual ~OpaqueBrowserFrameView(); |
| 31 | 33 |
| 32 // Overridden from BrowserNonClientFrameView: | 34 // Overridden from BrowserNonClientFrameView: |
| 33 virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const OVERRIDE; | 35 virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const OVERRIDE; |
| 34 virtual int GetHorizontalTabStripVerticalOffset(bool restored) const OVERRIDE; | 36 virtual int GetHorizontalTabStripVerticalOffset(bool restored) const OVERRIDE; |
| 35 virtual void UpdateThrobber(bool running) OVERRIDE; | 37 virtual void UpdateThrobber(bool running) OVERRIDE; |
| 36 virtual gfx::Size GetMinimumSize() OVERRIDE; | 38 virtual gfx::Size GetMinimumSize() OVERRIDE; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 64 // Overridden from views::View: | 66 // Overridden from views::View: |
| 65 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 67 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
| 66 virtual void Layout() OVERRIDE; | 68 virtual void Layout() OVERRIDE; |
| 67 virtual bool HitTest(const gfx::Point& l) const OVERRIDE; | 69 virtual bool HitTest(const gfx::Point& l) const OVERRIDE; |
| 68 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 70 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
| 69 | 71 |
| 70 // Overridden from views::ButtonListener: | 72 // Overridden from views::ButtonListener: |
| 71 virtual void ButtonPressed(views::Button* sender, const views::Event& event) | 73 virtual void ButtonPressed(views::Button* sender, const views::Event& event) |
| 72 OVERRIDE; | 74 OVERRIDE; |
| 73 | 75 |
| 74 // Overridden from TabIconView::TabIconViewModel: | 76 // Overridden from chrome::TabIconViewModel: |
| 75 virtual bool ShouldTabIconViewAnimate() const OVERRIDE; | 77 virtual bool ShouldTabIconViewAnimate() const OVERRIDE; |
| 76 virtual gfx::ImageSkia GetFaviconForTabIconView() OVERRIDE; | 78 virtual gfx::ImageSkia GetFaviconForTabIconView() OVERRIDE; |
| 77 | 79 |
| 78 // content::NotificationObserver implementation: | 80 // content::NotificationObserver implementation: |
| 79 virtual void Observe(int type, | 81 virtual void Observe(int type, |
| 80 const content::NotificationSource& source, | 82 const content::NotificationSource& source, |
| 81 const content::NotificationDetails& details) OVERRIDE; | 83 const content::NotificationDetails& details) OVERRIDE; |
| 82 | 84 |
| 83 private: | 85 private: |
| 84 // Creates, adds and returns a new image button with |this| as its listener. | 86 // Creates, adds and returns a new image button with |this| as its listener. |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 167 |
| 166 content::NotificationRegistrar registrar_; | 168 content::NotificationRegistrar registrar_; |
| 167 | 169 |
| 168 // Background painter for the window frame. | 170 // Background painter for the window frame. |
| 169 scoped_ptr<views::FrameBackground> frame_background_; | 171 scoped_ptr<views::FrameBackground> frame_background_; |
| 170 | 172 |
| 171 DISALLOW_COPY_AND_ASSIGN(OpaqueBrowserFrameView); | 173 DISALLOW_COPY_AND_ASSIGN(OpaqueBrowserFrameView); |
| 172 }; | 174 }; |
| 173 | 175 |
| 174 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ | 176 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ |
| OLD | NEW |