Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_BASE_MODELS_DIALOG_MODEL_H_ | 5 #ifndef UI_BASE_MODELS_DIALOG_MODEL_H_ |
| 6 #define UI_BASE_MODELS_DIALOG_MODEL_H_ | 6 #define UI_BASE_MODELS_DIALOG_MODEL_H_ |
| 7 | 7 |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "ui/base/ui_base_export.h" | 9 #include "ui/base/ui_base_export.h" |
| 10 #include "ui/base/ui_base_types.h" | 10 #include "ui/base/ui_base_types.h" |
| 11 | 11 |
| 12 namespace ui { | 12 namespace ui { |
| 13 | 13 |
| 14 // A model representing a dialog window. The model provides the content to show | 14 // A model representing a dialog window. The model provides the content to show |
| 15 // to the user (i.e. label, title), and the ways the user can interact with it | 15 // to the user (i.e. label, title), and the ways the user can interact with it |
|
kelvinp
2014/11/03 20:35:45
Should probably remove label in the line above as
sadrul
2014/11/03 22:42:22
Done.
| |
| 16 // (i.e. the buttons). | 16 // (i.e. the buttons). |
| 17 class UI_BASE_EXPORT DialogModel { | 17 class UI_BASE_EXPORT DialogModel { |
| 18 public: | 18 public: |
| 19 virtual ~DialogModel(); | 19 virtual ~DialogModel(); |
| 20 | 20 |
| 21 // Returns the text of show in the dialog. | |
| 22 virtual base::string16 GetDialogLabel() const = 0; | |
| 23 | |
| 24 // Returns the title of the dialog. | 21 // Returns the title of the dialog. |
| 25 virtual base::string16 GetDialogTitle() const = 0; | 22 virtual base::string16 GetDialogTitle() const = 0; |
| 26 | 23 |
| 27 // Returns a mask specifying which of the available DialogButtons are visible | 24 // Returns a mask specifying which of the available DialogButtons are visible |
| 28 // for the dialog. Note: Dialogs with just an OK button are frowned upon. | 25 // for the dialog. Note: Dialogs with just an OK button are frowned upon. |
| 29 virtual int GetDialogButtons() const = 0; | 26 virtual int GetDialogButtons() const = 0; |
| 30 | 27 |
| 31 // Returns the default dialog button. This should not be a mask as only | 28 // Returns the default dialog button. This should not be a mask as only |
| 32 // one button should ever be the default button. Return | 29 // one button should ever be the default button. Return |
| 33 // ui::DIALOG_BUTTON_NONE if there is no default. Default | 30 // ui::DIALOG_BUTTON_NONE if there is no default. Default |
| 34 // behavior is to return ui::DIALOG_BUTTON_OK or | 31 // behavior is to return ui::DIALOG_BUTTON_OK or |
| 35 // ui::DIALOG_BUTTON_CANCEL (in that order) if they are | 32 // ui::DIALOG_BUTTON_CANCEL (in that order) if they are |
| 36 // present, ui::DIALOG_BUTTON_NONE otherwise. | 33 // present, ui::DIALOG_BUTTON_NONE otherwise. |
| 37 virtual int GetDefaultDialogButton() const = 0; | 34 virtual int GetDefaultDialogButton() const = 0; |
| 38 | 35 |
| 39 // Returns whether the default dialog button should be colored blue as a call | 36 // Returns whether the default dialog button should be colored blue as a call |
| 40 // to action. | 37 // to action. |
| 41 virtual bool ShouldDefaultButtonBeBlue() const = 0; | 38 virtual bool ShouldDefaultButtonBeBlue() const = 0; |
| 42 | 39 |
| 43 // Returns the label of the specified dialog button. | 40 // Returns the label of the specified dialog button. |
| 44 virtual base::string16 GetDialogButtonLabel(DialogButton button) const = 0; | 41 virtual base::string16 GetDialogButtonLabel(DialogButton button) const = 0; |
| 45 | 42 |
| 46 // Returns whether the specified dialog button is enabled. | 43 // Returns whether the specified dialog button is enabled. |
| 47 virtual bool IsDialogButtonEnabled(DialogButton button) const = 0; | 44 virtual bool IsDialogButtonEnabled(DialogButton button) const = 0; |
| 48 }; | 45 }; |
| 49 | 46 |
| 50 } // namespace ui | 47 } // namespace ui |
| 51 | 48 |
| 52 #endif // UI_BASE_MODELS_DIALOG_MODEL_H_ | 49 #endif // UI_BASE_MODELS_DIALOG_MODEL_H_ |
| OLD | NEW |