Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: chrome/browser/intents/native_services.cc

Issue 11071005: Add native file picker impl using SelectFileDialog. (Closed) Base URL: http://git.chromium.org/chromium/src.git@filePicker
Patch Set: Don't use "DeleteService" as a method name since Windows munges it at compile time. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/string16.h" 7 #include "base/string16.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
(...skipping 11 matching lines...) Expand all
22 22
23 NativeServiceRegistry::NativeServiceRegistry() {} 23 NativeServiceRegistry::NativeServiceRegistry() {}
24 24
25 void NativeServiceRegistry::GetSupportedServices( 25 void NativeServiceRegistry::GetSupportedServices(
26 const string16& action, 26 const string16& action,
27 IntentServiceList* services) { 27 IntentServiceList* services) {
28 if (!CommandLine::ForCurrentProcess()->HasSwitch( 28 if (!CommandLine::ForCurrentProcess()->HasSwitch(
29 switches::kWebIntentsNativeServicesEnabled)) 29 switches::kWebIntentsNativeServicesEnabled))
30 return; 30 return;
31 31
32 #if defined(TOOLKIT_VIEWS) 32 #if !defined(ANDROID)
33 if (EqualsASCII(action, web_intents::kActionPick)) { 33 if (EqualsASCII(action, web_intents::kActionPick)) {
34 // File picker registrations. 34 // File picker registrations.
35 webkit_glue::WebIntentServiceData service( 35 webkit_glue::WebIntentServiceData service(
36 ASCIIToUTF16(kActionPick), 36 ASCIIToUTF16(kActionPick),
37 ASCIIToUTF16("*/*"), // handle any MIME-type 37 ASCIIToUTF16("*/*"), // handle any MIME-type
38 string16(), 38 string16(),
39 GURL(web_intents::kNativeFilePickerUrl), 39 GURL(web_intents::kNativeFilePickerUrl),
40 FilePickerFactory::GetServiceTitle()); 40 FilePickerFactory::GetServiceTitle());
41 service.disposition = webkit_glue::WebIntentServiceData::DISPOSITION_NATIVE; 41 service.disposition = webkit_glue::WebIntentServiceData::DISPOSITION_NATIVE;
42 42
43 services->push_back(service); 43 services->push_back(service);
44 } 44 }
45 #endif 45 #endif
46 } 46 }
47 47
48 NativeServiceFactory::NativeServiceFactory() {} 48 NativeServiceFactory::NativeServiceFactory() {}
49 49
50 IntentServiceHost* NativeServiceFactory::CreateServiceInstance( 50 IntentServiceHost* NativeServiceFactory::CreateServiceInstance(
51 const GURL& service_url, 51 const GURL& service_url,
52 const webkit_glue::WebIntentData& intent) { 52 const webkit_glue::WebIntentData& intent,
53 content::WebContents* web_contents) {
53 54
54 #if defined(TOOLKIT_VIEWS) 55 #if !defined(ANDROID)
55 if (service_url.spec() == kNativeFilePickerUrl) { 56 if (service_url.spec() == kNativeFilePickerUrl) {
56 return FilePickerFactory::CreateServiceInstance(intent); 57 return FilePickerFactory::CreateServiceInstance(intent, web_contents);
57 } 58 }
58 #endif 59 #endif
59 60
60 return NULL; // couldn't create instance 61 return NULL; // couldn't create instance
61 } 62 }
62 63
63 } // web_intents namespace 64 } // web_intents namespace
OLDNEW
« no previous file with comments | « chrome/browser/intents/native_services.h ('k') | chrome/browser/intents/native_services_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698