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

Side by Side Diff: chrome/browser/ui/views/web_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
(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 #include "base/logging.h"
6 #include "base/string16.h"
7 #include "chrome/browser/intents/intent_service_host.h"
8 #include "chrome/browser/intents/native_services.h"
9 #include "chrome/browser/intents/web_intents_util.h"
10 #include "content/public/browser/web_intents_dispatcher.h"
11 #include "googleurl/src/gurl.h"
12 #include "grit/generated_resources.h"
13 #include "ui/base/l10n/l10n_util.h"
14 #include "webkit/glue/web_intent_service_data.h"
15
16 namespace web_intents {
17 namespace {
18 // FilePicker service allowing a native file picker to handle
19 // pick+*/* intents.
20 class ViewsFilePickerService : public IntentServiceHost {
21 public:
22 ViewsFilePickerService();
23 virtual void HandleIntent(content::WebIntentsDispatcher* dispatcher) OVERRIDE;
24
25 private:
26 virtual ~ViewsFilePickerService();
27
28 DISALLOW_COPY_AND_ASSIGN(ViewsFilePickerService);
29 };
30
31 } // namespace
32
33 ViewsFilePickerService::ViewsFilePickerService() {}
34
35 void ViewsFilePickerService::HandleIntent(
36 content::WebIntentsDispatcher* dispatcher) {
37 dispatcher->SendReplyMessage(
38 webkit_glue::WEB_INTENT_REPLY_FAILURE, string16());
39 delete this;
40 }
41
42 ViewsFilePickerService::~ViewsFilePickerService() {}
43
44 // static
45 IntentServiceHost* FilePickerFactory::CreateServiceInstance(
46 const webkit_glue::WebIntentData& intent) {
47 return new ViewsFilePickerService();
48 }
49
50 // Returns the action-specific string for |action|.
51 string16 FilePickerFactory::GetServiceTitle() {
52 return l10n_util::GetStringUTF16(IDS_WEB_INTENTS_FILE_PICKER_SERVICE_TITLE);
53 }
54
55 } // web_intents namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/intents/web_intent_picker_controller.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698