OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DIALOG_CLIENT_VIEW_H_ | 5 #ifndef UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ |
6 #define UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ | 6 #define UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ |
7 | 7 |
8 #include "ui/base/ui_base_types.h" | 8 #include "ui/base/ui_base_types.h" |
9 #include "ui/views/controls/button/button.h" | 9 #include "ui/views/controls/button/button.h" |
10 #include "ui/views/focus/focus_manager.h" | 10 #include "ui/views/focus/focus_manager.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 void CancelWindow(); | 39 void CancelWindow(); |
40 | 40 |
41 // Accessors in case the user wishes to adjust these buttons. | 41 // Accessors in case the user wishes to adjust these buttons. |
42 LabelButton* ok_button() const { return ok_button_; } | 42 LabelButton* ok_button() const { return ok_button_; } |
43 LabelButton* cancel_button() const { return cancel_button_; } | 43 LabelButton* cancel_button() const { return cancel_button_; } |
44 | 44 |
45 // Update the dialog buttons to match the dialog's delegate. | 45 // Update the dialog buttons to match the dialog's delegate. |
46 void UpdateDialogButtons(); | 46 void UpdateDialogButtons(); |
47 | 47 |
48 // ClientView implementation: | 48 // ClientView implementation: |
49 virtual bool CanClose() OVERRIDE; | 49 virtual bool CanClose() override; |
50 virtual DialogClientView* AsDialogClientView() OVERRIDE; | 50 virtual DialogClientView* AsDialogClientView() override; |
51 virtual const DialogClientView* AsDialogClientView() const OVERRIDE; | 51 virtual const DialogClientView* AsDialogClientView() const override; |
52 | 52 |
53 // FocusChangeListener implementation: | 53 // FocusChangeListener implementation: |
54 virtual void OnWillChangeFocus(View* focused_before, | 54 virtual void OnWillChangeFocus(View* focused_before, |
55 View* focused_now) OVERRIDE; | 55 View* focused_now) override; |
56 virtual void OnDidChangeFocus(View* focused_before, | 56 virtual void OnDidChangeFocus(View* focused_before, |
57 View* focused_now) OVERRIDE; | 57 View* focused_now) override; |
58 | 58 |
59 // View implementation: | 59 // View implementation: |
60 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 60 virtual gfx::Size GetPreferredSize() const override; |
61 virtual void Layout() OVERRIDE; | 61 virtual void Layout() override; |
62 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 62 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
63 virtual void ViewHierarchyChanged( | 63 virtual void ViewHierarchyChanged( |
64 const ViewHierarchyChangedDetails& details) OVERRIDE; | 64 const ViewHierarchyChangedDetails& details) override; |
65 virtual void NativeViewHierarchyChanged() OVERRIDE; | 65 virtual void NativeViewHierarchyChanged() override; |
66 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE; | 66 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
67 | 67 |
68 // ButtonListener implementation: | 68 // ButtonListener implementation: |
69 virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE; | 69 virtual void ButtonPressed(Button* sender, const ui::Event& event) override; |
70 | 70 |
71 protected: | 71 protected: |
72 // For testing. | 72 // For testing. |
73 DialogClientView(View* contents_view); | 73 DialogClientView(View* contents_view); |
74 | 74 |
75 // Returns the DialogDelegate for the window. Virtual for testing. | 75 // Returns the DialogDelegate for the window. Virtual for testing. |
76 virtual DialogDelegate* GetDialogDelegate() const; | 76 virtual DialogDelegate* GetDialogDelegate() const; |
77 | 77 |
78 // Create and add the extra view, if supplied by the delegate. | 78 // Create and add the extra view, if supplied by the delegate. |
79 void CreateExtraView(); | 79 void CreateExtraView(); |
80 | 80 |
81 // Creates and adds the footnote view, if supplied by the delegate. | 81 // Creates and adds the footnote view, if supplied by the delegate. |
82 void CreateFootnoteView(); | 82 void CreateFootnoteView(); |
83 | 83 |
84 // View implementation. | 84 // View implementation. |
85 virtual void ChildPreferredSizeChanged(View* child) OVERRIDE; | 85 virtual void ChildPreferredSizeChanged(View* child) override; |
86 virtual void ChildVisibilityChanged(View* child) OVERRIDE; | 86 virtual void ChildVisibilityChanged(View* child) override; |
87 | 87 |
88 private: | 88 private: |
89 FRIEND_TEST_ALL_PREFIXES(DialogClientViewTest, FocusManager); | 89 FRIEND_TEST_ALL_PREFIXES(DialogClientViewTest, FocusManager); |
90 | 90 |
91 bool has_dialog_buttons() const { return ok_button_ || cancel_button_; } | 91 bool has_dialog_buttons() const { return ok_button_ || cancel_button_; } |
92 | 92 |
93 // Create a dialog button of the appropriate type. | 93 // Create a dialog button of the appropriate type. |
94 LabelButton* CreateDialogButton(ui::DialogButton type); | 94 LabelButton* CreateDialogButton(ui::DialogButton type); |
95 | 95 |
96 // Update |button|'s text and enabled state according to the delegate's state. | 96 // Update |button|'s text and enabled state according to the delegate's state. |
(...skipping 29 matching lines...) Expand all Loading... |
126 // http://crbug.com/71940). This is used to avoid notifying the delegate | 126 // http://crbug.com/71940). This is used to avoid notifying the delegate |
127 // twice, which can have bad consequences. | 127 // twice, which can have bad consequences. |
128 bool notified_delegate_; | 128 bool notified_delegate_; |
129 | 129 |
130 DISALLOW_COPY_AND_ASSIGN(DialogClientView); | 130 DISALLOW_COPY_AND_ASSIGN(DialogClientView); |
131 }; | 131 }; |
132 | 132 |
133 } // namespace views | 133 } // namespace views |
134 | 134 |
135 #endif // UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ | 135 #endif // UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ |
OLD | NEW |