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

Side by Side Diff: chrome/browser/chromeos/extensions/file_browser_private_api.cc

Issue 11741014: Move 'intents' parsing out of Extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed special_storage_policy unittest Created 7 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_special_storage_policy.cc » ('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/chromeos/extensions/file_browser_private_api.h" 5 #include "chrome/browser/chromeos/extensions/file_browser_private_api.h"
6 6
7 #include <sys/stat.h> 7 #include <sys/stat.h>
8 #include <sys/statvfs.h> 8 #include <sys/statvfs.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 #include <utime.h> 10 #include <utime.h>
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #include "chrome/browser/intents/web_intents_util.h" 53 #include "chrome/browser/intents/web_intents_util.h"
54 #include "chrome/browser/profiles/profile.h" 54 #include "chrome/browser/profiles/profile.h"
55 #include "chrome/browser/ui/browser.h" 55 #include "chrome/browser/ui/browser.h"
56 #include "chrome/browser/ui/browser_window.h" 56 #include "chrome/browser/ui/browser_window.h"
57 #include "chrome/browser/ui/views/select_file_dialog_extension.h" 57 #include "chrome/browser/ui/views/select_file_dialog_extension.h"
58 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" 58 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
59 #include "chrome/common/extensions/extension.h" 59 #include "chrome/common/extensions/extension.h"
60 #include "chrome/common/extensions/extension_constants.h" 60 #include "chrome/common/extensions/extension_constants.h"
61 #include "chrome/common/extensions/extension_icon_set.h" 61 #include "chrome/common/extensions/extension_icon_set.h"
62 #include "chrome/common/extensions/extension_manifest_constants.h" 62 #include "chrome/common/extensions/extension_manifest_constants.h"
63 #include "chrome/common/extensions/web_intents_handler.h"
63 #include "chrome/common/pref_names.h" 64 #include "chrome/common/pref_names.h"
64 #include "chromeos/disks/disk_mount_manager.h" 65 #include "chromeos/disks/disk_mount_manager.h"
65 #include "content/public/browser/child_process_security_policy.h" 66 #include "content/public/browser/child_process_security_policy.h"
66 #include "content/public/browser/render_process_host.h" 67 #include "content/public/browser/render_process_host.h"
67 #include "content/public/browser/render_view_host.h" 68 #include "content/public/browser/render_view_host.h"
68 #include "content/public/browser/storage_partition.h" 69 #include "content/public/browser/storage_partition.h"
69 #include "googleurl/src/gurl.h" 70 #include "googleurl/src/gurl.h"
70 #include "grit/generated_resources.h" 71 #include "grit/generated_resources.h"
71 #include "grit/platform_locale_settings.h" 72 #include "grit/platform_locale_settings.h"
72 #include "net/base/escape.h" 73 #include "net/base/escape.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 bool FindTitleForActionWithTypes( 262 bool FindTitleForActionWithTypes(
262 const Extension* extension, 263 const Extension* extension,
263 const std::string& action, 264 const std::string& action,
264 const std::set<std::string>& mime_types, 265 const std::set<std::string>& mime_types,
265 std::string* title) { 266 std::string* title) {
266 DCHECK(!mime_types.empty()); 267 DCHECK(!mime_types.empty());
267 std::set<std::string> pending(mime_types.begin(), mime_types.end()); 268 std::set<std::string> pending(mime_types.begin(), mime_types.end());
268 std::string found_title; 269 std::string found_title;
269 270
270 for (std::vector<webkit_glue::WebIntentServiceData>::const_iterator data = 271 for (std::vector<webkit_glue::WebIntentServiceData>::const_iterator data =
271 extension->intents_services().begin(); 272 extensions::WebIntentsInfo::GetIntentsServices(extension).begin();
272 data != extension->intents_services().end(); ++data) { 273 data != extensions::WebIntentsInfo::GetIntentsServices(extension).end();
274 ++data) {
273 if (pending.empty()) 275 if (pending.empty())
274 break; 276 break;
275 277
276 if (UTF16ToUTF8(data->action) != action) 278 if (UTF16ToUTF8(data->action) != action)
277 continue; 279 continue;
278 280
279 std::set<std::string>::iterator pending_iter = pending.begin(); 281 std::set<std::string>::iterator pending_iter = pending.begin();
280 while (pending_iter != pending.end()) { 282 while (pending_iter != pending.end()) {
281 std::set<std::string>::iterator current = pending_iter++; 283 std::set<std::string>::iterator current = pending_iter++;
282 if (net::MatchesMimeType(UTF16ToUTF8(data->type), *current)) 284 if (net::MatchesMimeType(UTF16ToUTF8(data->type), *current))
(...skipping 2730 matching lines...) Expand 10 before | Expand all | Expand 10 after
3013 // Keep the refcount until the zipping is complete on utility process. 3015 // Keep the refcount until the zipping is complete on utility process.
3014 AddRef(); 3016 AddRef();
3015 return true; 3017 return true;
3016 } 3018 }
3017 3019
3018 void ZipSelectionFunction::OnZipDone(bool success) { 3020 void ZipSelectionFunction::OnZipDone(bool success) {
3019 SetResult(new base::FundamentalValue(success)); 3021 SetResult(new base::FundamentalValue(success));
3020 SendResponse(true); 3022 SendResponse(true);
3021 Release(); 3023 Release();
3022 } 3024 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_special_storage_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698