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 "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "ui/base/ui_base_types.h" | 10 #include "ui/base/ui_base_types.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 // Accept or Cancel the dialog. | 36 // Accept or Cancel the dialog. |
37 void AcceptWindow(); | 37 void AcceptWindow(); |
38 void CancelWindow(); | 38 void CancelWindow(); |
39 | 39 |
40 // Accessors in case the user wishes to adjust these buttons. | 40 // Accessors in case the user wishes to adjust these buttons. |
41 LabelButton* ok_button() const { return ok_button_; } | 41 LabelButton* ok_button() const { return ok_button_; } |
42 LabelButton* cancel_button() const { return cancel_button_; } | 42 LabelButton* cancel_button() const { return cancel_button_; } |
43 | 43 |
44 // Update the dialog buttons to match the dialog's delegate. | 44 // Update the dialog buttons to match the dialog's delegate. |
45 void UpdateDialogButtons(); | 45 void UpdateDialogButtons(); |
| 46 void SetButtonRowInsets(const gfx::Insets& insets); |
46 | 47 |
47 // ClientView implementation: | 48 // ClientView implementation: |
48 bool CanClose() override; | 49 bool CanClose() override; |
49 DialogClientView* AsDialogClientView() override; | 50 DialogClientView* AsDialogClientView() override; |
50 const DialogClientView* AsDialogClientView() const override; | 51 const DialogClientView* AsDialogClientView() const override; |
51 | 52 |
52 // View implementation: | 53 // View implementation: |
53 gfx::Size GetPreferredSize() const override; | 54 gfx::Size GetPreferredSize() const override; |
54 gfx::Size GetMinimumSize() const override; | 55 gfx::Size GetMinimumSize() const override; |
55 gfx::Size GetMaximumSize() const override; | 56 gfx::Size GetMaximumSize() const override; |
56 | 57 |
57 void Layout() override; | 58 void Layout() override; |
58 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 59 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
59 void ViewHierarchyChanged( | 60 void ViewHierarchyChanged( |
60 const ViewHierarchyChangedDetails& details) override; | 61 const ViewHierarchyChangedDetails& details) override; |
61 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; | 62 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
62 | 63 |
63 // ButtonListener implementation: | 64 // ButtonListener implementation: |
64 void ButtonPressed(Button* sender, const ui::Event& event) override; | 65 void ButtonPressed(Button* sender, const ui::Event& event) override; |
65 | 66 |
66 void set_button_row_insets(const gfx::Insets& insets) { | |
67 button_row_insets_ = insets; | |
68 } | |
69 | |
70 void set_minimum_size(const gfx::Size& size) { minimum_size_ = size; } | 67 void set_minimum_size(const gfx::Size& size) { minimum_size_ = size; } |
71 | 68 |
72 private: | 69 private: |
73 enum { | 70 enum { |
74 // The number of buttons that DialogClientView can support. | 71 // The number of buttons that DialogClientView can support. |
75 kNumButtons = 3 | 72 kNumButtons = 3 |
76 }; | 73 }; |
77 class ButtonRowContainer; | 74 class ButtonRowContainer; |
78 | 75 |
79 // Returns the DialogDelegate for the window. | 76 // Returns the DialogDelegate for the window. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // Used to prevent unnecessary or potentially harmful changes during | 127 // Used to prevent unnecessary or potentially harmful changes during |
131 // SetupLayout(). Everything will be manually updated afterwards. | 128 // SetupLayout(). Everything will be manually updated afterwards. |
132 bool adding_or_removing_views_ = false; | 129 bool adding_or_removing_views_ = false; |
133 | 130 |
134 DISALLOW_COPY_AND_ASSIGN(DialogClientView); | 131 DISALLOW_COPY_AND_ASSIGN(DialogClientView); |
135 }; | 132 }; |
136 | 133 |
137 } // namespace views | 134 } // namespace views |
138 | 135 |
139 #endif // UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ | 136 #endif // UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ |
OLD | NEW |