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

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

Issue 6975037: Revert 85666 - Consolidate ShouldUseNativeFrame/AlwaysUseNativeFrame/UseNativeFrame spaghetti. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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 | « views/window/native_window_delegate.h ('k') | views/window/non_client_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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #pragma once 7 #pragma once
8 8
9 #include "base/task.h" 9 #include "base/task.h"
10 #include "views/view.h" 10 #include "views/view.h"
(...skipping 27 matching lines...) Expand all
38 void DisableInactiveRendering(bool disable) { 38 void DisableInactiveRendering(bool disable) {
39 paint_as_active_ = disable; 39 paint_as_active_ = disable;
40 if (!paint_as_active_) 40 if (!paint_as_active_)
41 SchedulePaint(); 41 SchedulePaint();
42 } 42 }
43 43
44 // Returns the bounds (in this View's parent's coordinates) that the client 44 // Returns the bounds (in this View's parent's coordinates) that the client
45 // view should be laid out within. 45 // view should be laid out within.
46 virtual gfx::Rect GetBoundsForClientView() const = 0; 46 virtual gfx::Rect GetBoundsForClientView() const = 0;
47 47
48 // Returns true if this FrameView should always use the custom frame,
49 // regardless of the system settings. An example is the Constrained Window,
50 // which is a child window and must always provide its own frame.
51 virtual bool AlwaysUseCustomFrame() const;
52
53 // Like AlwaysUseCustomFrame, returns true if this FrameView should always use
54 // the native frame, regardless of theme settings. An example is popup/app
55 // windows, which we do not ever want to show themed.
56 virtual bool AlwaysUseNativeFrame() const;
57
48 virtual gfx::Rect GetWindowBoundsForClientBounds( 58 virtual gfx::Rect GetWindowBoundsForClientBounds(
49 const gfx::Rect& client_bounds) const = 0; 59 const gfx::Rect& client_bounds) const = 0;
50 60
51 // This function must ask the ClientView to do a hittest. We don't do this in 61 // This function must ask the ClientView to do a hittest. We don't do this in
52 // the parent NonClientView because that makes it more difficult to calculate 62 // the parent NonClientView because that makes it more difficult to calculate
53 // hittests for regions that are partially obscured by the ClientView, e.g. 63 // hittests for regions that are partially obscured by the ClientView, e.g.
54 // HTSYSMENU. 64 // HTSYSMENU.
55 virtual int NonClientHitTest(const gfx::Point& point) = 0; 65 virtual int NonClientHitTest(const gfx::Point& point) = 0;
56 virtual void GetWindowMask(const gfx::Size& size, 66 virtual void GetWindowMask(const gfx::Size& size,
57 gfx::Path* window_mask) = 0; 67 gfx::Path* window_mask) = 0;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // closed, false otherwise. 154 // closed, false otherwise.
145 bool CanClose(); 155 bool CanClose();
146 156
147 // Called by the containing Window when it is closed. 157 // Called by the containing Window when it is closed.
148 void WindowClosing(); 158 void WindowClosing();
149 159
150 // Changes the frame from native to custom depending on the value of 160 // Changes the frame from native to custom depending on the value of
151 // |use_native_frame|. 161 // |use_native_frame|.
152 void UpdateFrame(); 162 void UpdateFrame();
153 163
164 // Returns true if the native window frame should be used, false if the
165 // NonClientView provides its own frame implementation.
166 bool UseNativeFrame() const;
167
154 // Prevents the window from being rendered as deactivated when |disable| is 168 // Prevents the window from being rendered as deactivated when |disable| is
155 // true, until called with |disable| false. Used when a sub-window is to be 169 // true, until called with |disable| false. Used when a sub-window is to be
156 // shown that shouldn't visually de-activate the window. 170 // shown that shouldn't visually de-activate the window.
157 // Subclasses can override this to perform additional actions when this value 171 // Subclasses can override this to perform additional actions when this value
158 // changes. 172 // changes.
159 void DisableInactiveRendering(bool disable); 173 void DisableInactiveRendering(bool disable);
160 174
161 // Returns the bounds of the window required to display the content area at 175 // Returns the bounds of the window required to display the content area at
162 // the specified bounds. 176 // the specified bounds.
163 gfx::Rect GetWindowBoundsForClientBounds(const gfx::Rect client_bounds) const; 177 gfx::Rect GetWindowBoundsForClientBounds(const gfx::Rect client_bounds) const;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 242
229 // The accessible name of this view. 243 // The accessible name of this view.
230 string16 accessible_name_; 244 string16 accessible_name_;
231 245
232 DISALLOW_COPY_AND_ASSIGN(NonClientView); 246 DISALLOW_COPY_AND_ASSIGN(NonClientView);
233 }; 247 };
234 248
235 } // namespace views 249 } // namespace views
236 250
237 #endif // #ifndef VIEWS_WINDOW_NON_CLIENT_VIEW_H_ 251 #endif // #ifndef VIEWS_WINDOW_NON_CLIENT_VIEW_H_
OLDNEW
« no previous file with comments | « views/window/native_window_delegate.h ('k') | views/window/non_client_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698