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 "chrome/browser/chromeos/extensions/file_browser_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/file_browser_private_api.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "chrome/browser/extensions/extension_service.h" | 33 #include "chrome/browser/extensions/extension_service.h" |
34 #include "chrome/browser/extensions/extension_tab_util.h" | 34 #include "chrome/browser/extensions/extension_tab_util.h" |
35 #include "chrome/browser/extensions/process_map.h" | 35 #include "chrome/browser/extensions/process_map.h" |
36 #include "chrome/browser/profiles/profile.h" | 36 #include "chrome/browser/profiles/profile.h" |
37 #include "chrome/browser/ui/browser.h" | 37 #include "chrome/browser/ui/browser.h" |
38 #include "chrome/browser/ui/browser_window.h" | 38 #include "chrome/browser/ui/browser_window.h" |
39 #include "chrome/browser/ui/views/select_file_dialog_extension.h" | 39 #include "chrome/browser/ui/views/select_file_dialog_extension.h" |
40 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 40 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
41 #include "chrome/common/chrome_version_info.h" | 41 #include "chrome/common/chrome_version_info.h" |
42 #include "chrome/common/extensions/extension.h" | 42 #include "chrome/common/extensions/extension.h" |
| 43 #include "chrome/common/extensions/extension_constants.h" |
43 #include "chrome/common/extensions/extension_icon_set.h" | 44 #include "chrome/common/extensions/extension_icon_set.h" |
44 #include "chrome/common/extensions/file_browser_handler.h" | 45 #include "chrome/common/extensions/file_browser_handler.h" |
45 #include "chrome/common/pref_names.h" | 46 #include "chrome/common/pref_names.h" |
46 #include "content/public/browser/child_process_security_policy.h" | 47 #include "content/public/browser/child_process_security_policy.h" |
47 #include "content/public/browser/render_process_host.h" | 48 #include "content/public/browser/render_process_host.h" |
48 #include "content/public/browser/render_view_host.h" | 49 #include "content/public/browser/render_view_host.h" |
49 #include "googleurl/src/gurl.h" | 50 #include "googleurl/src/gurl.h" |
50 #include "grit/generated_resources.h" | 51 #include "grit/generated_resources.h" |
51 #include "grit/platform_locale_settings.h" | 52 #include "grit/platform_locale_settings.h" |
52 #include "net/base/escape.h" | 53 #include "net/base/escape.h" |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 CHECK(extension); | 687 CHECK(extension); |
687 DictionaryValue* task = new DictionaryValue; | 688 DictionaryValue* task = new DictionaryValue; |
688 task->SetString("taskId", | 689 task->SetString("taskId", |
689 file_handler_util::MakeTaskID(extension_id, handler->id())); | 690 file_handler_util::MakeTaskID(extension_id, handler->id())); |
690 task->SetString("title", handler->title()); | 691 task->SetString("title", handler->title()); |
691 task->Set("patterns", URLPatternSetToStringList(iter->patterns)); | 692 task->Set("patterns", URLPatternSetToStringList(iter->patterns)); |
692 // TODO(zelidrag): Figure out how to expose icon URL that task defined in | 693 // TODO(zelidrag): Figure out how to expose icon URL that task defined in |
693 // manifest instead of the default extension icon. | 694 // manifest instead of the default extension icon. |
694 GURL icon = | 695 GURL icon = |
695 ExtensionIconSource::GetIconURL(extension, | 696 ExtensionIconSource::GetIconURL(extension, |
696 ExtensionIconSet::EXTENSION_ICON_BITTY, | 697 extension_misc::EXTENSION_ICON_BITTY, |
697 ExtensionIconSet::MATCH_BIGGER, | 698 ExtensionIconSet::MATCH_BIGGER, |
698 false, NULL); // grayscale | 699 false, NULL); // grayscale |
699 task->SetString("iconUrl", icon.spec()); | 700 task->SetString("iconUrl", icon.spec()); |
700 task->SetBoolean("driveApp", false); | 701 task->SetBoolean("driveApp", false); |
701 result_list->Append(task); | 702 result_list->Append(task); |
702 } | 703 } |
703 | 704 |
704 // Take the union of Drive and extension tasks: Because any extension tasks we | 705 // Take the union of Drive and extension tasks: Because any extension tasks we |
705 // found must apply to all of the files (intersection), and because the same | 706 // found must apply to all of the files (intersection), and because the same |
706 // is true of the drive apps, we simply take the union of two lists by adding | 707 // is true of the drive apps, we simply take the union of two lists by adding |
(...skipping 1724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2431 gdata::GDataSystemService* system_service = | 2432 gdata::GDataSystemService* system_service = |
2432 gdata::GDataSystemServiceFactory::GetForProfile(profile_); | 2433 gdata::GDataSystemServiceFactory::GetForProfile(profile_); |
2433 if (!system_service || !system_service->file_system()) | 2434 if (!system_service || !system_service->file_system()) |
2434 return false; | 2435 return false; |
2435 | 2436 |
2436 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string)); | 2437 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string)); |
2437 system_service->file_system()->RequestDirectoryRefresh(directory_path); | 2438 system_service->file_system()->RequestDirectoryRefresh(directory_path); |
2438 | 2439 |
2439 return true; | 2440 return true; |
2440 } | 2441 } |
OLD | NEW |