| 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 CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | |
| 10 #include "chrome/browser/ui/intents/web_intent_picker_model.h" | 9 #include "chrome/browser/ui/intents/web_intent_picker_model.h" |
| 11 | 10 |
| 12 namespace content { | 11 namespace content { |
| 13 class WebContents; | 12 class WebContents; |
| 14 } | 13 } |
| 15 | 14 |
| 16 // A class used to notify the delegate when the user has chosen a web intent | 15 // A class used to notify the delegate when the user has chosen a web intent |
| 17 // service. | 16 // service. |
| 18 class WebIntentPickerDelegate { | 17 class WebIntentPickerDelegate { |
| 19 public: | 18 public: |
| 20 typedef WebIntentPickerModel::Disposition Disposition; | 19 typedef WebIntentPickerModel::Disposition Disposition; |
| 21 | 20 |
| 22 // Base destructor. | 21 // Base destructor. |
| 23 virtual ~WebIntentPickerDelegate() {} | 22 virtual ~WebIntentPickerDelegate() {} |
| 24 | 23 |
| 25 // Called when the user has chosen a service. | 24 // Called when the user has chosen a service. |
| 26 virtual void OnServiceChosen(const GURL& url, Disposition disposition) = 0; | 25 virtual void OnServiceChosen(const GURL& url, Disposition disposition) = 0; |
| 27 | 26 |
| 28 // Called when the picker has created WebContents to use for inline | 27 // Called when the picker has created WebContents to use for inline |
| 29 // disposition. | 28 // disposition. |
| 30 virtual void OnInlineDispositionWebContentsCreated( | 29 virtual void OnInlineDispositionWebContentsCreated( |
| 31 content::WebContents* web_contents) = 0; | 30 content::WebContents* web_contents) = 0; |
| 32 | 31 |
| 33 // Called when the user has chosen to install a suggested extension. | |
| 34 virtual void OnExtensionInstallRequested(const std::string& id) = 0; | |
| 35 | |
| 36 // Called when the user cancels out of the dialog, whether by closing it | 32 // Called when the user cancels out of the dialog, whether by closing it |
| 37 // manually or otherwise purposefully. | 33 // manually or otherwise purposefully. |
| 38 virtual void OnCancelled() = 0; | 34 virtual void OnCancelled() = 0; |
| 39 | 35 |
| 40 // Called when the dialog stops showing. | 36 // Called when the dialog stops showing. |
| 41 virtual void OnClosing() = 0; | 37 virtual void OnClosing() = 0; |
| 42 }; | 38 }; |
| 43 | 39 |
| 44 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_DELEGATE_H_ | 40 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_DELEGATE_H_ |
| OLD | NEW |