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

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

Issue 229343004: Revert 262516 "Remove title and icon from chrome apps native style title bars." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | « no previous file | 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 "third_party/skia/include/core/SkColor.h"
(...skipping 22 matching lines...) Expand all
33 namespace apps { 33 namespace apps {
34 34
35 class NativeAppWindow; 35 class NativeAppWindow;
36 36
37 // A frameless or non-Ash, non-panel NonClientFrameView for app windows. 37 // A frameless or non-Ash, non-panel NonClientFrameView for app windows.
38 class AppWindowFrameView : public views::NonClientFrameView, 38 class AppWindowFrameView : public views::NonClientFrameView,
39 public views::ButtonListener { 39 public views::ButtonListener {
40 public: 40 public:
41 static const char kViewClassName[]; 41 static const char kViewClassName[];
42 42
43 // AppWindowFrameView is used to draw frames for app windows when a non 43 explicit AppWindowFrameView();
44 // standard frame is needed. This occurs if there is no frame needed, or if
45 // there is a frame color.
46 // If |draw_frame| is true, the view draws its own window title area and
47 // controls, using |frame_color|. If |draw_frame| is not true, no frame is
48 // drawn.
49 // TODO(benwells): Refactor this to split out frameless and colored frame
50 // views. See http://crbug.com/359432.
51 AppWindowFrameView(views::Widget* widget,
52 NativeAppWindow* window,
53 bool draw_frame,
54 const SkColor& frame_color);
55 virtual ~AppWindowFrameView(); 44 virtual ~AppWindowFrameView();
56 45
57 void Init(); 46 // Initializes this for |widget|. Sets the number of pixels for which a click
58 47 // is interpreted as a resize for the inner and outer border of the window
59 void SetResizeSizes(int resize_inside_bounds_size, 48 // and the lower-right corner resize handle. If |draw_frame|, the view draws
60 int resize_outside_bounds_size, 49 // its own window title area and controls, using |frame_color| (otherwise
61 int resize_area_corner_size); 50 // |frame_color| is ignored).
62 int resize_inside_bounds_size() const { 51 void Init(views::Widget* widget,
63 return resize_inside_bounds_size_; 52 NativeAppWindow* window,
64 }; 53 bool draw_frame,
54 const SkColor& frame_color,
55 int resize_inside_bounds_size,
56 int resize_outside_bounds_size,
57 int resize_outside_scale_for_touch,
58 int resize_area_corner_size);
65 59
66 private: 60 private:
67 // views::NonClientFrameView implementation. 61 // views::NonClientFrameView implementation.
68 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; 62 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE;
69 virtual gfx::Rect GetWindowBoundsForClientBounds( 63 virtual gfx::Rect GetWindowBoundsForClientBounds(
70 const gfx::Rect& client_bounds) const OVERRIDE; 64 const gfx::Rect& client_bounds) const OVERRIDE;
71 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; 65 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE;
72 virtual void GetWindowMask(const gfx::Size& size, 66 virtual void GetWindowMask(const gfx::Size& size,
73 gfx::Path* window_mask) OVERRIDE; 67 gfx::Path* window_mask) OVERRIDE;
74 virtual void ResetWindowControls() OVERRIDE {} 68 virtual void ResetWindowControls() OVERRIDE {}
(...skipping 29 matching lines...) Expand all
104 98
105 // Size in pixels of the lower-right corner resize handle. 99 // Size in pixels of the lower-right corner resize handle.
106 int resize_area_corner_size_; 100 int resize_area_corner_size_;
107 101
108 DISALLOW_COPY_AND_ASSIGN(AppWindowFrameView); 102 DISALLOW_COPY_AND_ASSIGN(AppWindowFrameView);
109 }; 103 };
110 104
111 } // namespace apps 105 } // namespace apps
112 106
113 #endif // APPS_UI_VIEWS_APP_WINDOW_FRAME_VIEW_H_ 107 #endif // APPS_UI_VIEWS_APP_WINDOW_FRAME_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | apps/ui/views/app_window_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698