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 #include "content/renderer/web_intents_host.h" | 5 #include "content/renderer/web_intents_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "content/common/intents_messages.h" | 10 #include "content/common/intents_messages.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 } else if (intent_->data_type == webkit_glue::WebIntentData::FILESYSTEM) { | 173 } else if (intent_->data_type == webkit_glue::WebIntentData::FILESYSTEM) { |
174 const GURL origin = GURL(frame->document().securityOrigin().toString()); | 174 const GURL origin = GURL(frame->document().securityOrigin().toString()); |
175 const GURL root_url = | 175 const GURL root_url = |
176 fileapi::GetFileSystemRootURI(origin, fileapi::kFileSystemTypeIsolated); | 176 fileapi::GetFileSystemRootURI(origin, fileapi::kFileSystemTypeIsolated); |
177 const std::string fsname = | 177 const std::string fsname = |
178 fileapi::GetIsolatedFileSystemName(origin, intent_->filesystem_id); | 178 fileapi::GetIsolatedFileSystemName(origin, intent_->filesystem_id); |
179 const std::string url = base::StringPrintf( | 179 const std::string url = base::StringPrintf( |
180 "%s%s/%s/", | 180 "%s%s/%s/", |
181 root_url.spec().c_str(), | 181 root_url.spec().c_str(), |
182 intent_->filesystem_id.c_str(), | 182 intent_->filesystem_id.c_str(), |
183 intent_->root_path.BaseName().AsUTF8Unsafe().c_str()); | 183 intent_->root_name.c_str()); |
184 // TODO(kmadhusu): This is a temporary hack to create a serializable file | 184 // TODO(kmadhusu): This is a temporary hack to create a serializable file |
185 // system. Once we have a better way to create a serializable file system, | 185 // system. Once we have a better way to create a serializable file system, |
186 // remove this hack. | 186 // remove this hack. |
187 v8::Handle<v8::Value> filesystem_V8 = frame->createSerializableFileSystem( | 187 v8::Handle<v8::Value> filesystem_V8 = frame->createSerializableFileSystem( |
188 WebKit::WebFileSystem::TypeIsolated, | 188 WebKit::WebFileSystem::TypeIsolated, |
189 WebKit::WebString::fromUTF8(fsname), | 189 WebKit::WebString::fromUTF8(fsname), |
190 WebKit::WebString::fromUTF8(url)); | 190 WebKit::WebString::fromUTF8(url)); |
191 WebSerializedScriptValue serialized_data = | 191 WebSerializedScriptValue serialized_data = |
192 WebSerializedScriptValue::serialize(filesystem_V8); | 192 WebSerializedScriptValue::serialize(filesystem_V8); |
193 web_intent = WebIntent::create(intent_->action, intent_->type, | 193 web_intent = WebIntent::create(intent_->action, intent_->type, |
194 serialized_data.toString(), | 194 serialized_data.toString(), |
195 extras_keys, extras_values); | 195 extras_keys, extras_values); |
196 } else { | 196 } else { |
197 NOTREACHED(); | 197 NOTREACHED(); |
198 } | 198 } |
199 | 199 |
200 if (!web_intent.action().isEmpty()) | 200 if (!web_intent.action().isEmpty()) |
201 frame->deliverIntent(web_intent, NULL, delivered_intent_client_.get()); | 201 frame->deliverIntent(web_intent, NULL, delivered_intent_client_.get()); |
202 } | 202 } |
OLD | NEW |