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

Side by Side Diff: views/window/non_client_view.h

Issue 577018: Support app menu and double-click close on upper left corner of window, part ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 10 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 VIEWS_WINDOW_NON_CLIENT_VIEW_H_ 5 #ifndef VIEWS_WINDOW_NON_CLIENT_VIEW_H_
6 #define VIEWS_WINDOW_NON_CLIENT_VIEW_H_ 6 #define VIEWS_WINDOW_NON_CLIENT_VIEW_H_
7 7
8 #include "base/task.h" 8 #include "base/task.h"
9 #include "views/view.h" 9 #include "views/view.h"
10 #include "views/window/client_view.h" 10 #include "views/window/client_view.h"
11 11
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // which is a child window and must always provide its own frame. 49 // which is a child window and must always provide its own frame.
50 virtual bool AlwaysUseCustomFrame() const { return false; } 50 virtual bool AlwaysUseCustomFrame() const { return false; }
51 51
52 // Like AlwaysUseCustomFrame, returns true if this FrameView should always use 52 // Like AlwaysUseCustomFrame, returns true if this FrameView should always use
53 // the native frame, regardless of theme settings. An example is popup/app 53 // the native frame, regardless of theme settings. An example is popup/app
54 // windows, which we do not ever want to show themed. 54 // windows, which we do not ever want to show themed.
55 virtual bool AlwaysUseNativeFrame() const { return false; } 55 virtual bool AlwaysUseNativeFrame() const { return false; }
56 56
57 virtual gfx::Rect GetWindowBoundsForClientBounds( 57 virtual gfx::Rect GetWindowBoundsForClientBounds(
58 const gfx::Rect& client_bounds) const = 0; 58 const gfx::Rect& client_bounds) const = 0;
59 virtual gfx::Point GetSystemMenuPoint() const = 0;
60 virtual int NonClientHitTest(const gfx::Point& point) = 0; 59 virtual int NonClientHitTest(const gfx::Point& point) = 0;
61 virtual void GetWindowMask(const gfx::Size& size, 60 virtual void GetWindowMask(const gfx::Size& size,
62 gfx::Path* window_mask) = 0; 61 gfx::Path* window_mask) = 0;
63 virtual void EnableClose(bool enable) = 0; 62 virtual void EnableClose(bool enable) = 0;
64 virtual void ResetWindowControls() = 0; 63 virtual void ResetWindowControls() = 0;
65 64
66 // Overridden from View: 65 // Overridden from View:
67 virtual bool HitTest(const gfx::Point& l) const; 66 virtual bool HitTest(const gfx::Point& l) const;
68 67
69 protected: 68 protected:
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // true, until called with |disable| false. Used when a sub-window is to be 162 // true, until called with |disable| false. Used when a sub-window is to be
164 // shown that shouldn't visually de-activate the window. 163 // shown that shouldn't visually de-activate the window.
165 // Subclasses can override this to perform additional actions when this value 164 // Subclasses can override this to perform additional actions when this value
166 // changes. 165 // changes.
167 void DisableInactiveRendering(bool disable); 166 void DisableInactiveRendering(bool disable);
168 167
169 // Returns the bounds of the window required to display the content area at 168 // Returns the bounds of the window required to display the content area at
170 // the specified bounds. 169 // the specified bounds.
171 gfx::Rect GetWindowBoundsForClientBounds(const gfx::Rect client_bounds) const; 170 gfx::Rect GetWindowBoundsForClientBounds(const gfx::Rect client_bounds) const;
172 171
173 // Returns the point, in screen coordinates, where the system menu should
174 // be shown so it shows up anchored to the system menu icon.
175 gfx::Point GetSystemMenuPoint() const;
176
177 // Determines the windows HT* code when the mouse cursor is at the 172 // Determines the windows HT* code when the mouse cursor is at the
178 // specified point, in window coordinates. 173 // specified point, in window coordinates.
179 int NonClientHitTest(const gfx::Point& point); 174 int NonClientHitTest(const gfx::Point& point);
180 175
181 // Returns a mask to be used to clip the top level window for the given 176 // Returns a mask to be used to clip the top level window for the given
182 // size. This is used to create the non-rectangular window shape. 177 // size. This is used to create the non-rectangular window shape.
183 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); 178 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask);
184 179
185 // Toggles the enable state for the Close button (and the Close menu item in 180 // Toggles the enable state for the Close button (and the Close menu item in
186 // the system menu). 181 // the system menu).
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 228
234 // The accessible name of this view. 229 // The accessible name of this view.
235 std::wstring accessible_name_; 230 std::wstring accessible_name_;
236 231
237 DISALLOW_COPY_AND_ASSIGN(NonClientView); 232 DISALLOW_COPY_AND_ASSIGN(NonClientView);
238 }; 233 };
239 234
240 } // namespace views 235 } // namespace views
241 236
242 #endif // #ifndef VIEWS_WINDOW_NON_CLIENT_VIEW_H_ 237 #endif // #ifndef VIEWS_WINDOW_NON_CLIENT_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698