| 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 CHROME_BROWSER_UI_PROTOCOL_DIALOG_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_PROTOCOL_DIALOG_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_UI_PROTOCOL_DIALOG_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_PROTOCOL_DIALOG_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "ui/base/ui_base_types.h" |
| 8 #include "url/gurl.h" | 9 #include "url/gurl.h" |
| 9 | 10 |
| 10 // Interface implemented by objects that wish to show a dialog box Window for | 11 // Interface implemented by objects that wish to show a dialog box Window for |
| 11 // handling special protocols. The window that is displayed uses this interface | 12 // handling special protocols. The window that is displayed uses this interface |
| 12 // to determine the text displayed and notify the delegate object of certain | 13 // to determine the text displayed and notify the delegate object of certain |
| 13 // events. | 14 // events. |
| 14 class ProtocolDialogDelegate { | 15 class ProtocolDialogDelegate { |
| 15 public: | 16 public: |
| 16 explicit ProtocolDialogDelegate(const GURL& url) : url_(url) {} | 17 explicit ProtocolDialogDelegate(const GURL& url) : url_(url) {} |
| 17 virtual ~ProtocolDialogDelegate() {} | 18 virtual ~ProtocolDialogDelegate() {} |
| 18 | 19 |
| 19 // Called if the user has chosen to launch the application for this protocol. | 20 // Called if the user has chosen to launch the application for this protocol. |
| 20 // |dont_block| is true if the checkbox to prevent future instances of this | 21 // |dont_block| is true if the checkbox to prevent future instances of this |
| 21 // dialog is checked. | 22 // dialog is checked. |
| 22 virtual void DoAccept(const GURL& url, bool dont_block) const = 0; | 23 virtual void DoAccept(const GURL& url, bool dont_block) const = 0; |
| 23 | 24 |
| 24 // Called if the user has chosen to do nothing for this protocol. | 25 // Called if the user has chosen to do nothing for this protocol. |
| 25 // |dont_block| is true if the checkbox to prevent future instances of this | 26 // |dont_block| is true if the checkbox to prevent future instances of this |
| 26 // dialog is checked. | 27 // dialog is checked. |
| 27 virtual void DoCancel(const GURL& url, bool dont_block) const = 0; | 28 virtual void DoCancel(const GURL& url, bool dont_block) const = 0; |
| 28 | 29 |
| 30 virtual base::string16 GetDialogButtonLabel( |
| 31 ui::DialogButton button) const = 0; |
| 29 virtual base::string16 GetMessageText() const = 0; | 32 virtual base::string16 GetMessageText() const = 0; |
| 30 virtual base::string16 GetCheckboxText() const = 0; | 33 virtual base::string16 GetCheckboxText() const = 0; |
| 31 virtual base::string16 GetTitleText() const = 0; | 34 virtual base::string16 GetTitleText() const = 0; |
| 32 | 35 |
| 33 const GURL& url() const { return url_; } | 36 const GURL& url() const { return url_; } |
| 34 | 37 |
| 35 private: | 38 private: |
| 36 const GURL url_; | 39 const GURL url_; |
| 37 }; | 40 }; |
| 38 | 41 |
| 39 #endif // CHROME_BROWSER_UI_PROTOCOL_DIALOG_DELEGATE_H_ | 42 #endif // CHROME_BROWSER_UI_PROTOCOL_DIALOG_DELEGATE_H_ |
| OLD | NEW |