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

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

Issue 11786003: Move Icons out of Extension class (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_unref_browser_action
Patch Set: License year update 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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>
11 #include <utility> 11 #include <utility>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "chrome/browser/google_apis/drive_service_interface.h" 49 #include "chrome/browser/google_apis/drive_service_interface.h"
50 #include "chrome/browser/google_apis/gdata_wapi_parser.h" 50 #include "chrome/browser/google_apis/gdata_wapi_parser.h"
51 #include "chrome/browser/google_apis/operation_registry.h" 51 #include "chrome/browser/google_apis/operation_registry.h"
52 #include "chrome/browser/google_apis/time_util.h" 52 #include "chrome/browser/google_apis/time_util.h"
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/api/icons/icons_handler.h"
59 #include "chrome/common/extensions/extension.h" 60 #include "chrome/common/extensions/extension.h"
60 #include "chrome/common/extensions/extension_constants.h" 61 #include "chrome/common/extensions/extension_constants.h"
61 #include "chrome/common/extensions/extension_icon_set.h" 62 #include "chrome/common/extensions/extension_icon_set.h"
62 #include "chrome/common/extensions/extension_manifest_constants.h" 63 #include "chrome/common/extensions/extension_manifest_constants.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"
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 924
924 for (FileHandlerList::iterator i = file_handlers.begin(); 925 for (FileHandlerList::iterator i = file_handlers.begin();
925 i != file_handlers.end(); ++i) { 926 i != file_handlers.end(); ++i) {
926 DictionaryValue* task = new DictionaryValue; 927 DictionaryValue* task = new DictionaryValue;
927 std::string task_id = file_handler_util::MakeTaskID(extension->id(), 928 std::string task_id = file_handler_util::MakeTaskID(extension->id(),
928 file_handler_util::kTaskApp, (*i)->id); 929 file_handler_util::kTaskApp, (*i)->id);
929 task->SetString("taskId", task_id); 930 task->SetString("taskId", task_id);
930 task->SetString("title", (*i)->title); 931 task->SetString("title", (*i)->title);
931 task->SetBoolean("isDefault", false); 932 task->SetBoolean("isDefault", false);
932 933
933 GURL best_icon = extension->GetIconURL(kPreferredIconSize, 934 GURL best_icon = extensions::IconsInfo::GetIconURL(
934 ExtensionIconSet::MATCH_BIGGER); 935 extension, kPreferredIconSize,ExtensionIconSet::MATCH_BIGGER);
935 if (!best_icon.is_empty()) 936 if (!best_icon.is_empty())
936 task->SetString("iconUrl", best_icon.spec()); 937 task->SetString("iconUrl", best_icon.spec());
937 else 938 else
938 task->SetString("iconUrl", kDefaultIcon); 939 task->SetString("iconUrl", kDefaultIcon);
939 940
940 task->SetBoolean("driveApp", false); 941 task->SetBoolean("driveApp", false);
941 result_list->Append(task); 942 result_list->Append(task);
942 } 943 }
943 } 944 }
944 945
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 extension, web_intents::kActionView, mime_types, &title)) 977 extension, web_intents::kActionView, mime_types, &title))
977 continue; 978 continue;
978 979
979 DictionaryValue* task = new DictionaryValue; 980 DictionaryValue* task = new DictionaryValue;
980 std::string task_id = file_handler_util::MakeTaskID(extension->id(), 981 std::string task_id = file_handler_util::MakeTaskID(extension->id(),
981 file_handler_util::kTaskWebIntent, web_intents::kActionView); 982 file_handler_util::kTaskWebIntent, web_intents::kActionView);
982 task->SetString("taskId", task_id); 983 task->SetString("taskId", task_id);
983 task->SetString("title", title); 984 task->SetString("title", title);
984 task->SetBoolean("isDefault", false); 985 task->SetBoolean("isDefault", false);
985 986
986 GURL best_icon = extension->GetIconURL(kPreferredIconSize, 987 GURL best_icon = extensions::IconsInfo::GetIconURL(
987 ExtensionIconSet::MATCH_BIGGER); 988 extension, kPreferredIconSize,ExtensionIconSet::MATCH_BIGGER);
988 if (!best_icon.is_empty()) 989 if (!best_icon.is_empty())
989 task->SetString("iconUrl", best_icon.spec()); 990 task->SetString("iconUrl", best_icon.spec());
990 else 991 else
991 task->SetString("iconUrl", kDefaultIcon); 992 task->SetString("iconUrl", kDefaultIcon);
992 993
993 task->SetBoolean("driveApp", false); 994 task->SetBoolean("driveApp", false);
994 result_list->Append(task); 995 result_list->Append(task);
995 } 996 }
996 997
997 return true; 998 return true;
(...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after
3013 // Keep the refcount until the zipping is complete on utility process. 3014 // Keep the refcount until the zipping is complete on utility process.
3014 AddRef(); 3015 AddRef();
3015 return true; 3016 return true;
3016 } 3017 }
3017 3018
3018 void ZipSelectionFunction::OnZipDone(bool success) { 3019 void ZipSelectionFunction::OnZipDone(bool success) {
3019 SetResult(new base::FundamentalValue(success)); 3020 SetResult(new base::FundamentalValue(success));
3020 SendResponse(true); 3021 SendResponse(true);
3021 Release(); 3022 Release();
3022 } 3023 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698