| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_DELEGATE_H_ | |
| 6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_DELEGATE_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include "chrome/browser/ui/intents/web_intent_picker_model.h" | |
| 10 #include "ui/base/window_open_disposition.h" | |
| 11 | |
| 12 namespace content { | |
| 13 class WebContents; | |
| 14 } | |
| 15 | |
| 16 class Profile; | |
| 17 | |
| 18 // A class used to notify the delegate when the user has chosen a web intent | |
| 19 // service. | |
| 20 class WebIntentPickerDelegate { | |
| 21 public: | |
| 22 enum DefaultsUsage { | |
| 23 kEnableDefaults = 0, | |
| 24 kSuppressDefaults = 1, | |
| 25 }; | |
| 26 | |
| 27 // Base destructor. | |
| 28 virtual ~WebIntentPickerDelegate() {} | |
| 29 | |
| 30 // Called when the user has chosen a service. | |
| 31 virtual void OnServiceChosen( | |
| 32 const GURL& url, | |
| 33 webkit_glue::WebIntentServiceData::Disposition disposition, | |
| 34 DefaultsUsage suppress_defaults) = 0; | |
| 35 | |
| 36 // Called to create the WebContents into which the inline disposition will be | |
| 37 // placed. | |
| 38 virtual content::WebContents* CreateWebContentsForInlineDisposition( | |
| 39 Profile* profile, const GURL& url) = 0; | |
| 40 | |
| 41 // Called when the user has chosen to install a suggested extension. | |
| 42 virtual void OnExtensionInstallRequested(const std::string& id) = 0; | |
| 43 | |
| 44 // Called when the user has chosen to visit the CWS entry for an extension. | |
| 45 // |id| is the extension id. | |
| 46 // |disposition| is user-requested disposition for opening the extension | |
| 47 // link. | |
| 48 virtual void OnExtensionLinkClicked( | |
| 49 const std::string& id, | |
| 50 WindowOpenDisposition disposition) = 0; | |
| 51 | |
| 52 // Called when the user chooses to get more suggestions from CWS. | |
| 53 // |disposition| is user-requested disposition for opening the suggestions | |
| 54 // link. | |
| 55 virtual void OnSuggestionsLinkClicked(WindowOpenDisposition disposition) = 0; | |
| 56 | |
| 57 // Called when the user cancels out of the dialog. | |
| 58 virtual void OnUserCancelledPickerDialog() = 0; | |
| 59 | |
| 60 // Called when the user wants to pick another service from within inline | |
| 61 // disposition. | |
| 62 virtual void OnChooseAnotherService() = 0; | |
| 63 | |
| 64 // Called when the dialog stops showing. | |
| 65 virtual void OnClosing() = 0; | |
| 66 }; | |
| 67 | |
| 68 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_DELEGATE_H_ | |
| OLD | NEW |