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

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

Issue 8869005: Revert EnableClose() removal and related crash fixes. I don't understand the crashes here, and th... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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) 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 UI_VIEWS_WINDOW_NON_CLIENT_VIEW_H_ 5 #ifndef UI_VIEWS_WINDOW_NON_CLIENT_VIEW_H_
6 #define UI_VIEWS_WINDOW_NON_CLIENT_VIEW_H_ 6 #define UI_VIEWS_WINDOW_NON_CLIENT_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include "ui/views/view.h" 9 #include "ui/views/view.h"
10 #include "ui/views/window/client_view.h" 10 #include "ui/views/window/client_view.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 virtual gfx::Rect GetWindowBoundsForClientBounds( 46 virtual gfx::Rect GetWindowBoundsForClientBounds(
47 const gfx::Rect& client_bounds) const = 0; 47 const gfx::Rect& client_bounds) const = 0;
48 48
49 // This function must ask the ClientView to do a hittest. We don't do this in 49 // This function must ask the ClientView to do a hittest. We don't do this in
50 // the parent NonClientView because that makes it more difficult to calculate 50 // the parent NonClientView because that makes it more difficult to calculate
51 // hittests for regions that are partially obscured by the ClientView, e.g. 51 // hittests for regions that are partially obscured by the ClientView, e.g.
52 // HTSYSMENU. 52 // HTSYSMENU.
53 virtual int NonClientHitTest(const gfx::Point& point) = 0; 53 virtual int NonClientHitTest(const gfx::Point& point) = 0;
54 virtual void GetWindowMask(const gfx::Size& size, 54 virtual void GetWindowMask(const gfx::Size& size,
55 gfx::Path* window_mask) = 0; 55 gfx::Path* window_mask) = 0;
56 virtual void EnableClose(bool enable) = 0;
56 virtual void ResetWindowControls() = 0; 57 virtual void ResetWindowControls() = 0;
57 virtual void UpdateWindowIcon() = 0; 58 virtual void UpdateWindowIcon() = 0;
58 59
59 // Overridden from View: 60 // Overridden from View:
60 virtual bool HitTest(const gfx::Point& l) const OVERRIDE; 61 virtual bool HitTest(const gfx::Point& l) const OVERRIDE;
61 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; 62 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
62 virtual std::string GetClassName() const OVERRIDE; 63 virtual std::string GetClassName() const OVERRIDE;
63 64
64 protected: 65 protected:
65 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; 66 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 gfx::Rect GetWindowBoundsForClientBounds(const gfx::Rect client_bounds) const; 168 gfx::Rect GetWindowBoundsForClientBounds(const gfx::Rect client_bounds) const;
168 169
169 // Determines the windows HT* code when the mouse cursor is at the 170 // Determines the windows HT* code when the mouse cursor is at the
170 // specified point, in window coordinates. 171 // specified point, in window coordinates.
171 int NonClientHitTest(const gfx::Point& point); 172 int NonClientHitTest(const gfx::Point& point);
172 173
173 // Returns a mask to be used to clip the top level window for the given 174 // Returns a mask to be used to clip the top level window for the given
174 // size. This is used to create the non-rectangular window shape. 175 // size. This is used to create the non-rectangular window shape.
175 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); 176 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask);
176 177
178 // Toggles the enable state for the Close button (and the Close menu item in
179 // the system menu).
180 void EnableClose(bool enable);
181
177 // Tells the window controls as rendered by the NonClientView to reset 182 // Tells the window controls as rendered by the NonClientView to reset
178 // themselves to a normal state. This happens in situations where the 183 // themselves to a normal state. This happens in situations where the
179 // containing window does not receive a normal sequences of messages that 184 // containing window does not receive a normal sequences of messages that
180 // would lead to the controls returning to this normal state naturally, e.g. 185 // would lead to the controls returning to this normal state naturally, e.g.
181 // when the window is maximized, minimized or restored. 186 // when the window is maximized, minimized or restored.
182 void ResetWindowControls(); 187 void ResetWindowControls();
183 188
184 // Tells the NonClientView to invalidate the NonClientFrameView's window icon. 189 // Tells the NonClientView to invalidate the NonClientFrameView's window icon.
185 void UpdateWindowIcon(); 190 void UpdateWindowIcon();
186 191
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 231
227 // The accessible name of this view. 232 // The accessible name of this view.
228 string16 accessible_name_; 233 string16 accessible_name_;
229 234
230 DISALLOW_COPY_AND_ASSIGN(NonClientView); 235 DISALLOW_COPY_AND_ASSIGN(NonClientView);
231 }; 236 };
232 237
233 } // namespace views 238 } // namespace views
234 239
235 #endif // UI_VIEWS_WINDOW_NON_CLIENT_VIEW_H_ 240 #endif // UI_VIEWS_WINDOW_NON_CLIENT_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698