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

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

Issue 10825042: Implement media path filter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/content_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/intents/device_attached_intent_source.h" 5 #include "chrome/browser/intents/device_attached_intent_source.h"
6 6
7 #include <string>
8
7 #include "base/file_path.h" 9 #include "base/file_path.h"
8 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/ui/browser.h" 11 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_window.h" 12 #include "chrome/browser/ui/browser_window.h"
11 #include "content/public/browser/web_intents_dispatcher.h" 13 #include "content/public/browser/web_intents_dispatcher.h"
12 #include "content/public/browser/web_contents_delegate.h" 14 #include "content/public/browser/web_contents_delegate.h"
13 #include "webkit/fileapi/file_system_types.h" 15 #include "webkit/fileapi/file_system_types.h"
14 #include "webkit/fileapi/isolated_context.h" 16 #include "webkit/fileapi/isolated_context.h"
15 #include "webkit/glue/web_intent_data.h" 17 #include "webkit/glue/web_intent_data.h"
16 18
(...skipping 30 matching lines...) Expand all
47 const FilePath device_path(location); 49 const FilePath device_path(location);
48 if (!device_path.IsAbsolute() || device_path.ReferencesParent()) 50 if (!device_path.IsAbsolute() || device_path.ReferencesParent())
49 return; 51 return;
50 52
51 std::string device_name; 53 std::string device_name;
52 54
53 // Register device path as an isolated file system. 55 // Register device path as an isolated file system.
54 // TODO(kinuko, kmadhusu): Use a different file system type for MTP. 56 // TODO(kinuko, kmadhusu): Use a different file system type for MTP.
55 const std::string filesystem_id = 57 const std::string filesystem_id =
56 fileapi::IsolatedContext::GetInstance()->RegisterFileSystemForPath( 58 fileapi::IsolatedContext::GetInstance()->RegisterFileSystemForPath(
57 fileapi::kFileSystemTypeIsolated, device_path, &device_name); 59 fileapi::kFileSystemTypeNativeMedia, device_path, &device_name);
58 60
59 CHECK(!filesystem_id.empty()); 61 CHECK(!filesystem_id.empty());
60 webkit_glue::WebIntentData intent( 62 webkit_glue::WebIntentData intent(
61 ASCIIToUTF16("chrome-extension://attach"), 63 ASCIIToUTF16("chrome-extension://attach"),
62 ASCIIToUTF16("chrome-extension://filesystem"), 64 ASCIIToUTF16("chrome-extension://filesystem"),
63 device_name, 65 device_name,
64 filesystem_id); 66 filesystem_id);
65 67
66 delegate_->WebIntentDispatch(NULL /* no WebContents */, 68 delegate_->WebIntentDispatch(NULL /* no WebContents */,
67 content::WebIntentsDispatcher::Create(intent)); 69 content::WebIntentsDispatcher::Create(intent));
68 } 70 }
OLDNEW
« no previous file with comments | « no previous file | content/content_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698