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_EXTENSIONS_SHELL_WINDOW_FRAME_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_SHELL_WINDOW_FRAME_VIEW_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "ui/gfx/path.h" |
| 11 #include "ui/gfx/rect.h" |
| 12 #include "ui/gfx/size.h" |
| 13 #include "ui/views/controls/button/button.h" |
| 14 #include "ui/views/window/non_client_view.h" |
| 15 |
| 16 namespace gfx { |
| 17 class Canvas; |
| 18 class Point; |
| 19 } |
| 20 |
| 21 namespace ui { |
| 22 class Event; |
| 23 } |
| 24 |
| 25 namespace views { |
| 26 class ImageButton; |
| 27 class Widget; |
| 28 } |
| 29 |
| 30 class NativeAppWindowViews; |
| 31 |
| 32 // A frameless or non-Ash, non-panel NonClientFrameView for app windows. |
| 33 class ShellWindowFrameView : public views::NonClientFrameView, |
| 34 public views::ButtonListener { |
| 35 public: |
| 36 static const char kViewClassName[]; |
| 37 |
| 38 explicit ShellWindowFrameView(NativeAppWindowViews* window); |
| 39 virtual ~ShellWindowFrameView(); |
| 40 |
| 41 void Init(views::Widget* frame); |
| 42 |
| 43 private: |
| 44 // views::NonClientFrameView implementation. |
| 45 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; |
| 46 virtual gfx::Rect GetWindowBoundsForClientBounds( |
| 47 const gfx::Rect& client_bounds) const OVERRIDE; |
| 48 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; |
| 49 virtual void GetWindowMask(const gfx::Size& size, |
| 50 gfx::Path* window_mask) OVERRIDE; |
| 51 virtual void ResetWindowControls() OVERRIDE {} |
| 52 virtual void UpdateWindowIcon() OVERRIDE {} |
| 53 virtual void UpdateWindowTitle() OVERRIDE {} |
| 54 |
| 55 // views::View implementation. |
| 56 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 57 virtual void Layout() OVERRIDE; |
| 58 virtual std::string GetClassName() const OVERRIDE; |
| 59 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
| 60 virtual gfx::Size GetMinimumSize() OVERRIDE; |
| 61 virtual gfx::Size GetMaximumSize() OVERRIDE; |
| 62 |
| 63 // views::ButtonListener implementation. |
| 64 virtual void ButtonPressed(views::Button* sender, const ui::Event& event) |
| 65 OVERRIDE; |
| 66 |
| 67 NativeAppWindowViews* window_; |
| 68 views::Widget* frame_; |
| 69 views::ImageButton* close_button_; |
| 70 views::ImageButton* maximize_button_; |
| 71 views::ImageButton* restore_button_; |
| 72 views::ImageButton* minimize_button_; |
| 73 |
| 74 DISALLOW_COPY_AND_ASSIGN(ShellWindowFrameView); |
| 75 }; |
| 76 |
| 77 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_SHELL_WINDOW_FRAME_VIEW_H_ |
OLD | NEW |