Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: apps/ui/views/app_window_frame_view.h

Issue 210363004: Linux: App windows with frame: chrome and no color are now native. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't need not IsFrameless(); that is implied by has_frame_color_. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « apps/app_window_browsertest.cc ('k') | apps/ui/views/app_window_frame_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 APPS_UI_VIEWS_APP_WINDOW_FRAME_VIEW_H_ 5 #ifndef APPS_UI_VIEWS_APP_WINDOW_FRAME_VIEW_H_
6 #define APPS_UI_VIEWS_APP_WINDOW_FRAME_VIEW_H_ 6 #define APPS_UI_VIEWS_APP_WINDOW_FRAME_VIEW_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "third_party/skia/include/core/SkColor.h"
10 #include "ui/gfx/path.h" 11 #include "ui/gfx/path.h"
11 #include "ui/gfx/rect.h" 12 #include "ui/gfx/rect.h"
12 #include "ui/gfx/size.h" 13 #include "ui/gfx/size.h"
13 #include "ui/views/controls/button/button.h" 14 #include "ui/views/controls/button/button.h"
14 #include "ui/views/window/non_client_view.h" 15 #include "ui/views/window/non_client_view.h"
15 16
17 class SkRegion;
18
16 namespace gfx { 19 namespace gfx {
17 class Canvas; 20 class Canvas;
18 class Point; 21 class Point;
19 } 22 }
20 23
21 namespace ui { 24 namespace ui {
22 class Event; 25 class Event;
23 } 26 }
24 27
25 namespace views { 28 namespace views {
26 class ImageButton; 29 class ImageButton;
27 class Widget; 30 class Widget;
28 } 31 }
29 32
30 namespace apps { 33 namespace apps {
31 34
32 class NativeAppWindow;
33
34 // A frameless or non-Ash, non-panel NonClientFrameView for app windows. 35 // A frameless or non-Ash, non-panel NonClientFrameView for app windows.
35 class AppWindowFrameView : public views::NonClientFrameView, 36 class AppWindowFrameView : public views::NonClientFrameView,
36 public views::ButtonListener { 37 public views::ButtonListener {
37 public: 38 public:
38 static const char kViewClassName[]; 39 static const char kViewClassName[];
39 40
40 explicit AppWindowFrameView(NativeAppWindow* window); 41 explicit AppWindowFrameView();
41 virtual ~AppWindowFrameView(); 42 virtual ~AppWindowFrameView();
42 43
43 // Initializes this for |widget|. Sets the number of pixels for which a click 44 // Initializes this for |widget|. Sets the number of pixels for which a click
44 // is interpreted as a resize for the inner and outer border of the window 45 // is interpreted as a resize for the inner and outer border of the window
45 // and the lower-right corner resize handle. 46 // and the lower-right corner resize handle. If |draw_frame|, the view draws
47 // its own window title area and controls, using |frame_color| (otherwise
48 // |frame_color| is ignored). |draggable_region| may be NULL.
46 void Init(views::Widget* widget, 49 void Init(views::Widget* widget,
50 bool draw_frame,
47 const SkColor& frame_color, 51 const SkColor& frame_color,
52 const SkRegion* draggable_region,
48 int resize_inside_bounds_size, 53 int resize_inside_bounds_size,
49 int resize_outside_bounds_size, 54 int resize_outside_bounds_size,
50 int resize_outside_scale_for_touch, 55 int resize_outside_scale_for_touch,
51 int resize_area_corner_size); 56 int resize_area_corner_size);
52 57
53 private: 58 private:
54 // views::NonClientFrameView implementation. 59 // views::NonClientFrameView implementation.
55 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; 60 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE;
56 virtual gfx::Rect GetWindowBoundsForClientBounds( 61 virtual gfx::Rect GetWindowBoundsForClientBounds(
57 const gfx::Rect& client_bounds) const OVERRIDE; 62 const gfx::Rect& client_bounds) const OVERRIDE;
58 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; 63 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE;
59 virtual void GetWindowMask(const gfx::Size& size, 64 virtual void GetWindowMask(const gfx::Size& size,
60 gfx::Path* window_mask) OVERRIDE; 65 gfx::Path* window_mask) OVERRIDE;
61 virtual void ResetWindowControls() OVERRIDE {} 66 virtual void ResetWindowControls() OVERRIDE {}
62 virtual void UpdateWindowIcon() OVERRIDE {} 67 virtual void UpdateWindowIcon() OVERRIDE {}
63 virtual void UpdateWindowTitle() OVERRIDE {} 68 virtual void UpdateWindowTitle() OVERRIDE {}
64 69
65 // views::View implementation. 70 // views::View implementation.
66 virtual gfx::Size GetPreferredSize() OVERRIDE; 71 virtual gfx::Size GetPreferredSize() OVERRIDE;
67 virtual void Layout() OVERRIDE; 72 virtual void Layout() OVERRIDE;
68 virtual const char* GetClassName() const OVERRIDE; 73 virtual const char* GetClassName() const OVERRIDE;
69 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 74 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
70 virtual gfx::Size GetMinimumSize() OVERRIDE; 75 virtual gfx::Size GetMinimumSize() OVERRIDE;
71 virtual gfx::Size GetMaximumSize() OVERRIDE; 76 virtual gfx::Size GetMaximumSize() OVERRIDE;
72 77
73 // views::ButtonListener implementation. 78 // views::ButtonListener implementation.
74 virtual void ButtonPressed(views::Button* sender, 79 virtual void ButtonPressed(views::Button* sender,
75 const ui::Event& event) OVERRIDE; 80 const ui::Event& event) OVERRIDE;
76 81
77 NativeAppWindow* window_;
78 views::Widget* widget_; 82 views::Widget* widget_;
83 bool draw_frame_;
79 SkColor frame_color_; 84 SkColor frame_color_;
85 const SkRegion* draggable_region_;
80 views::ImageButton* close_button_; 86 views::ImageButton* close_button_;
81 views::ImageButton* maximize_button_; 87 views::ImageButton* maximize_button_;
82 views::ImageButton* restore_button_; 88 views::ImageButton* restore_button_;
83 views::ImageButton* minimize_button_; 89 views::ImageButton* minimize_button_;
84 90
85 // Allow resize for clicks this many pixels inside the bounds. 91 // Allow resize for clicks this many pixels inside the bounds.
86 int resize_inside_bounds_size_; 92 int resize_inside_bounds_size_;
87 93
88 // Allow resize for clicks this many pixels outside the bounds. 94 // Allow resize for clicks this many pixels outside the bounds.
89 int resize_outside_bounds_size_; 95 int resize_outside_bounds_size_;
90 96
91 // Size in pixels of the lower-right corner resize handle. 97 // Size in pixels of the lower-right corner resize handle.
92 int resize_area_corner_size_; 98 int resize_area_corner_size_;
93 99
94 DISALLOW_COPY_AND_ASSIGN(AppWindowFrameView); 100 DISALLOW_COPY_AND_ASSIGN(AppWindowFrameView);
95 }; 101 };
96 102
97 } // namespace apps 103 } // namespace apps
98 104
99 #endif // APPS_UI_VIEWS_APP_WINDOW_FRAME_VIEW_H_ 105 #endif // APPS_UI_VIEWS_APP_WINDOW_FRAME_VIEW_H_
OLDNEW
« no previous file with comments | « apps/app_window_browsertest.cc ('k') | apps/ui/views/app_window_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698