| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_AURA_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_AURA_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" | |
| 11 #include "chrome/browser/ui/views/tab_icon_view.h" | |
| 12 #include "ui/views/controls/button/button.h" // ButtonListener | |
| 13 | |
| 14 namespace ash { | |
| 15 class FramePainter; | |
| 16 } | |
| 17 namespace views { | |
| 18 class ImageButton; | |
| 19 } | |
| 20 | |
| 21 class BrowserNonClientFrameViewAura : public BrowserNonClientFrameView, | |
| 22 public views::ButtonListener, | |
| 23 public TabIconView::TabIconViewModel { | |
| 24 public: | |
| 25 BrowserNonClientFrameViewAura(BrowserFrame* frame, BrowserView* browser_view); | |
| 26 virtual ~BrowserNonClientFrameViewAura(); | |
| 27 | |
| 28 void Init(); | |
| 29 | |
| 30 // BrowserNonClientFrameView overrides: | |
| 31 virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const OVERRIDE; | |
| 32 virtual int GetHorizontalTabStripVerticalOffset( | |
| 33 bool force_restored) const OVERRIDE; | |
| 34 virtual void UpdateThrobber(bool running) OVERRIDE; | |
| 35 | |
| 36 // views::NonClientFrameView overrides: | |
| 37 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; | |
| 38 virtual gfx::Rect GetWindowBoundsForClientBounds( | |
| 39 const gfx::Rect& client_bounds) const OVERRIDE; | |
| 40 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; | |
| 41 virtual void GetWindowMask(const gfx::Size& size, | |
| 42 gfx::Path* window_mask) OVERRIDE; | |
| 43 virtual void ResetWindowControls() OVERRIDE; | |
| 44 virtual void UpdateWindowIcon() OVERRIDE; | |
| 45 | |
| 46 // views::View overrides: | |
| 47 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | |
| 48 virtual void Layout() OVERRIDE; | |
| 49 virtual bool HitTest(const gfx::Point& l) const OVERRIDE; | |
| 50 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | |
| 51 virtual gfx::Size GetMinimumSize() OVERRIDE; | |
| 52 | |
| 53 // views::ButtonListener overrides: | |
| 54 virtual void ButtonPressed(views::Button* sender, | |
| 55 const views::Event& event) OVERRIDE; | |
| 56 | |
| 57 // Overridden from TabIconView::TabIconViewModel: | |
| 58 virtual bool ShouldTabIconViewAnimate() const OVERRIDE; | |
| 59 virtual SkBitmap GetFaviconForTabIconView() OVERRIDE; | |
| 60 | |
| 61 private: | |
| 62 // Distance between top of window and client area. | |
| 63 int NonClientTopBorderHeight(bool force_restored) const; | |
| 64 | |
| 65 // Layout the incognito icon. | |
| 66 void LayoutAvatar(); | |
| 67 | |
| 68 void PaintTitleBar(gfx::Canvas* canvas); | |
| 69 void PaintToolbarBackground(gfx::Canvas* canvas); | |
| 70 | |
| 71 // Windows without a toolbar need to draw their own line under the header, | |
| 72 // above the content area. | |
| 73 void PaintContentEdge(gfx::Canvas* canvas); | |
| 74 | |
| 75 // Returns the correct bitmap id for the frame header based on activation | |
| 76 // state and incognito mode. | |
| 77 int GetThemeFrameBitmapId() const; | |
| 78 const SkBitmap* GetThemeFrameOverlayBitmap() const; | |
| 79 | |
| 80 // Window controls. The |size_button_| either toggles maximized or toggles | |
| 81 // minimized. The exact behavior is determined by |size_button_minimizes_|. | |
| 82 views::ImageButton* size_button_; | |
| 83 views::ImageButton* close_button_; | |
| 84 | |
| 85 // For popups, the window icon. | |
| 86 TabIconView* window_icon_; | |
| 87 | |
| 88 // Painter for the frame header. | |
| 89 scoped_ptr<ash::FramePainter> frame_painter_; | |
| 90 | |
| 91 // If true the |size_button_| minimizes, otherwise it toggles between | |
| 92 // maximized and restored. | |
| 93 bool size_button_minimizes_; | |
| 94 | |
| 95 DISALLOW_COPY_AND_ASSIGN(BrowserNonClientFrameViewAura); | |
| 96 }; | |
| 97 | |
| 98 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_AURA_H_ | |
| OLD | NEW |