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

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

Issue 8227003: Views Bubble API adjustments and cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add close_on_esc setting and fade-in functionality. Created 9 years, 2 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/widget/widget_delegate.cc ('k') | views/window/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_CLIENT_VIEW_H_ 5 #ifndef VIEWS_WINDOW_CLIENT_VIEW_H_
6 #define VIEWS_WINDOW_CLIENT_VIEW_H_ 6 #define VIEWS_WINDOW_CLIENT_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include "views/view.h" 9 #include "views/view.h"
10 10
(...skipping 28 matching lines...) Expand all
39 virtual const DialogClientView* AsDialogClientView() const; 39 virtual const DialogClientView* AsDialogClientView() const;
40 virtual BubbleView* AsBubbleView(); 40 virtual BubbleView* AsBubbleView();
41 virtual const BubbleView* AsBubbleView() const; 41 virtual const BubbleView* AsBubbleView() const;
42 42
43 // Returns true to signal that the Widget can be closed. Specialized 43 // Returns true to signal that the Widget can be closed. Specialized
44 // ClientView subclasses can override this default behavior to allow the 44 // ClientView subclasses can override this default behavior to allow the
45 // close to be blocked until the user corrects mistakes, accepts a warning 45 // close to be blocked until the user corrects mistakes, accepts a warning
46 // dialog, etc. 46 // dialog, etc.
47 virtual bool CanClose(); 47 virtual bool CanClose();
48 48
49 // Notification that the widget is closing. The default implementation 49 // Notification that the widget is closing.
50 // forwards the notification to the delegate.
51 virtual void WidgetClosing(); 50 virtual void WidgetClosing();
52 51
53 // Tests to see if the specified point (in view coordinates) is within the 52 // Tests to see if the specified point (in view coordinates) is within the
54 // bounds of this view. If so, it returns HTCLIENT in this default 53 // bounds of this view. If so, it returns HTCLIENT in this default
55 // implementation. If it is outside the bounds of this view, this must return 54 // implementation. If it is outside the bounds of this view, this must return
56 // HTNOWHERE to tell the caller to do further processing to determine where 55 // HTNOWHERE to tell the caller to do further processing to determine where
57 // in the non-client area it is (if it is). 56 // in the non-client area it is (if it is).
58 // Subclasses of ClientView can extend this logic by overriding this method 57 // Subclasses of ClientView can extend this logic by overriding this method
59 // to detect if regions within the client area count as parts of the "non- 58 // to detect if regions within the client area count as parts of the "non-
60 // client" area. A good example of this is the size box at the bottom right 59 // client" area. A good example of this is the size box at the bottom right
61 // corner of resizable dialog boxes. 60 // corner of resizable dialog boxes.
62 virtual int NonClientHitTest(const gfx::Point& point); 61 virtual int NonClientHitTest(const gfx::Point& point);
63 62
64 // Overridden from View: 63 // Overridden from View:
65 virtual gfx::Size GetPreferredSize() OVERRIDE; 64 virtual gfx::Size GetPreferredSize() OVERRIDE;
66 virtual void Layout() OVERRIDE; 65 virtual void Layout() OVERRIDE;
67 virtual std::string GetClassName() const OVERRIDE; 66 virtual std::string GetClassName() const OVERRIDE;
68 67
69 protected: 68 protected:
70 // Overridden from View: 69 // Overridden from View:
71 virtual void ViewHierarchyChanged( 70 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
72 bool is_add, View* parent, View* child) OVERRIDE;
73 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; 71 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
74 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; 72 virtual void ViewHierarchyChanged(bool is_add,
73 View* parent,
74 View* child) OVERRIDE;
75 75
76 // Accessors for private data members. 76 // Accessors for private data members.
77 View* contents_view() const { return contents_view_; } 77 View* contents_view() const { return contents_view_; }
78 void set_contents_view(View* contents_view) { 78 void set_contents_view(View* contents_view) {
79 contents_view_ = contents_view; 79 contents_view_ = contents_view;
80 } 80 }
81 81
82 private: 82 private:
83 // The Widget that hosts this ClientView. 83 // The Widget that hosts this ClientView.
84 Widget* widget_; 84 Widget* widget_;
85 85
86 // The View that this ClientView contains. 86 // The View that this ClientView contains.
87 View* contents_view_; 87 View* contents_view_;
88 }; 88 };
89 89
90 } // namespace views 90 } // namespace views
91 91
92 #endif // #ifndef VIEWS_WINDOW_CLIENT_VIEW_H_ 92 #endif // #ifndef VIEWS_WINDOW_CLIENT_VIEW_H_
OLDNEW
« no previous file with comments | « views/widget/widget_delegate.cc ('k') | views/window/client_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698