Chromium Code Reviews| 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_INTENTS_NATIVE_SERVICES_H_ | 5 #ifndef CHROME_BROWSER_INTENTS_NATIVE_SERVICES_H_ |
| 6 #define CHROME_BROWSER_INTENTS_NATIVE_SERVICES_H_ | 6 #define CHROME_BROWSER_INTENTS_NATIVE_SERVICES_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| 11 | 11 |
| 12 class GURL; | 12 class GURL; |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 class WebContents; | |
| 15 class WebIntentsDispatcher; | 16 class WebIntentsDispatcher; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace webkit_glue { | 19 namespace webkit_glue { |
| 19 struct WebIntentData; | 20 struct WebIntentData; |
| 20 struct WebIntentServiceData; | 21 struct WebIntentServiceData; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace web_intents { | 24 namespace web_intents { |
| 24 | 25 |
| 25 class IntentServiceHost; | 26 class IntentServiceHost; |
| 26 | 27 |
| 27 extern const char kChromeNativeSerivceScheme[]; | 28 extern const char kChromeNativeSerivceScheme[]; |
| 28 extern const char kNativeFilePickerUrl[]; | 29 extern const char kNativeFilePickerUrl[]; |
| 29 | 30 |
| 30 typedef std::vector<webkit_glue::WebIntentServiceData> IntentServiceList; | 31 typedef std::vector<webkit_glue::WebIntentServiceData> IntentServiceList; |
| 31 | 32 |
| 32 #if defined(TOOLKIT_VIEWS) | |
| 33 // Factory capable of producing a file picker NativeService. | 33 // Factory capable of producing a file picker NativeService. |
| 34 class FilePickerFactory { | 34 class FilePickerFactory { |
| 35 public: | 35 public: |
| 36 // Returns a localized title for the file picker. | 36 // Returns a localized title for the file picker. |
| 37 static string16 GetServiceTitle(); | 37 static string16 GetServiceTitle(); |
| 38 | 38 |
| 39 // Returns a new instance of FilePickerService. | 39 // Returns a new instance of FilePickerService. |
| 40 static IntentServiceHost* CreateServiceInstance( | 40 static IntentServiceHost* CreateServiceInstance( |
| 41 const webkit_glue::WebIntentData& intent); | 41 const webkit_glue::WebIntentData& intent, |
| 42 content::WebContents* web_contents); | |
| 43 | |
| 42 DISALLOW_COPY_AND_ASSIGN(FilePickerFactory); | 44 DISALLOW_COPY_AND_ASSIGN(FilePickerFactory); |
| 43 }; | 45 }; |
| 44 #endif | |
| 45 | 46 |
| 46 class NativeServiceRegistry { | 47 class NativeServiceRegistry { |
| 47 public: | 48 public: |
| 48 NativeServiceRegistry(); | 49 NativeServiceRegistry(); |
| 49 // Populates |services| with all supported native services. | 50 // Populates |services| with all supported native services. |
| 50 void GetSupportedServices( | 51 void GetSupportedServices( |
| 51 const string16& action, | 52 const string16& action, |
| 52 IntentServiceList* services); | 53 IntentServiceList* services); |
| 54 | |
| 53 DISALLOW_COPY_AND_ASSIGN(NativeServiceRegistry); | 55 DISALLOW_COPY_AND_ASSIGN(NativeServiceRegistry); |
| 54 }; | 56 }; |
| 55 | 57 |
| 56 class NativeServiceFactory { | 58 class NativeServiceFactory { |
| 57 public: | 59 public: |
| 58 NativeServiceFactory(); | 60 NativeServiceFactory(); |
| 59 // Returns a NativeService instance suitable to handle | 61 // Returns a NativeService instance suitable to handle |
|
Greg Billock
2012/10/10 17:12:51
Add what the |url| and |web_contents| are.
Steve McKay
2012/10/10 23:12:57
Done.
| |
| 60 // |intent|. | 62 // |intent|. |
| 61 IntentServiceHost* CreateServiceInstance( | 63 IntentServiceHost* CreateServiceInstance( |
| 62 const GURL& url, | 64 const GURL& url, |
| 63 const webkit_glue::WebIntentData& intent); | 65 const webkit_glue::WebIntentData& intent, |
| 66 content::WebContents* web_contents); | |
| 67 | |
| 64 DISALLOW_COPY_AND_ASSIGN(NativeServiceFactory); | 68 DISALLOW_COPY_AND_ASSIGN(NativeServiceFactory); |
| 65 }; | 69 }; |
| 66 | 70 |
| 67 } // web_intents namespaces | 71 } // web_intents namespaces |
| 68 | 72 |
| 69 #endif // CHROME_BROWSER_INTENTS_NATIVE_SERVICES_H_ | 73 #endif // CHROME_BROWSER_INTENTS_NATIVE_SERVICES_H_ |
| OLD | NEW |