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

Side by Side Diff: chrome/browser/extensions/api/developer_private/developer_private_api.cc

Issue 12093036: Move Extension Location and Type enums to Manifest, and move InstallWarning to its own file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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
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/extensions/api/developer_private/developer_private_api. h" 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api. h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 else 135 else
136 NOTREACHED(); 136 NOTREACHED();
137 } else if (item.is_theme()) { 137 } else if (item.is_theme()) {
138 info->type = developer::ITEM_TYPE_THEME; 138 info->type = developer::ITEM_TYPE_THEME;
139 } else if (item.is_extension()) { 139 } else if (item.is_extension()) {
140 info->type = developer::ITEM_TYPE_EXTENSION; 140 info->type = developer::ITEM_TYPE_EXTENSION;
141 } else { 141 } else {
142 NOTREACHED(); 142 NOTREACHED();
143 } 143 }
144 144
145 if (item.location() == Extension::LOAD) { 145 if (item.location() == Manifest::LOAD) {
146 info->path.reset( 146 info->path.reset(
147 new std::string(UTF16ToUTF8(item.path().LossyDisplayName()))); 147 new std::string(UTF16ToUTF8(item.path().LossyDisplayName())));
148 } 148 }
149 149
150 info->incognito_enabled = service->IsIncognitoEnabled(item.id()); 150 info->incognito_enabled = service->IsIncognitoEnabled(item.id());
151 info->wants_file_access = item.wants_file_access(); 151 info->wants_file_access = item.wants_file_access();
152 info->allow_file_access = service->AllowFileAccess(&item); 152 info->allow_file_access = service->AllowFileAccess(&item);
153 info->allow_reload = (item.location() == Extension::LOAD); 153 info->allow_reload = (item.location() == Manifest::LOAD);
154 info->is_unpacked = (item.location() == Extension::LOAD); 154 info->is_unpacked = (item.location() == Manifest::LOAD);
155 info->terminated = service->terminated_extensions()->Contains(item.id()); 155 info->terminated = service->terminated_extensions()->Contains(item.id());
156 info->allow_incognito = item.can_be_incognito_enabled(); 156 info->allow_incognito = item.can_be_incognito_enabled();
157 157
158 GURL icon = 158 GURL icon =
159 ExtensionIconSource::GetIconURL(&item, 159 ExtensionIconSource::GetIconURL(&item,
160 extension_misc::EXTENSION_ICON_MEDIUM, 160 extension_misc::EXTENSION_ICON_MEDIUM,
161 ExtensionIconSet::MATCH_BIGGER, 161 ExtensionIconSet::MATCH_BIGGER,
162 !info->enabled, 162 !info->enabled,
163 NULL); 163 NULL);
164 info->icon = icon.spec(); 164 info->icon = icon.spec();
(...skipping 23 matching lines...) Expand all
188 return info.Pass(); 188 return info.Pass();
189 } 189 }
190 190
191 void DeveloperPrivateGetItemsInfoFunction::AddItemsInfo( 191 void DeveloperPrivateGetItemsInfoFunction::AddItemsInfo(
192 const ExtensionSet& items, 192 const ExtensionSet& items,
193 ExtensionSystem* system, 193 ExtensionSystem* system,
194 ItemInfoList* item_list) { 194 ItemInfoList* item_list) {
195 for (ExtensionSet::const_iterator iter = items.begin(); 195 for (ExtensionSet::const_iterator iter = items.begin();
196 iter != items.end(); ++iter) { 196 iter != items.end(); ++iter) {
197 const Extension& item = **iter; 197 const Extension& item = **iter;
198 if (item.location() == Extension::COMPONENT) 198 if (item.location() == Manifest::COMPONENT)
199 continue; // Skip built-in extensions / apps; 199 continue; // Skip built-in extensions / apps;
200 item_list->push_back(make_linked_ptr<developer::ItemInfo>( 200 item_list->push_back(make_linked_ptr<developer::ItemInfo>(
201 CreateItemInfo(item, system, false).release())); 201 CreateItemInfo(item, system, false).release()));
202 } 202 }
203 } 203 }
204 204
205 void DeveloperPrivateGetItemsInfoFunction:: 205 void DeveloperPrivateGetItemsInfoFunction::
206 GetInspectablePagesForExtensionProcess( 206 GetInspectablePagesForExtensionProcess(
207 const std::set<content::RenderViewHost*>& views, 207 const std::set<content::RenderViewHost*>& views,
208 ItemInspectViewList* result) { 208 ItemInspectViewList* result) {
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 633
634 #undef SET_STRING 634 #undef SET_STRING
635 return true; 635 return true;
636 } 636 }
637 637
638 DeveloperPrivateGetStringsFunction::~DeveloperPrivateGetStringsFunction() {} 638 DeveloperPrivateGetStringsFunction::~DeveloperPrivateGetStringsFunction() {}
639 639
640 } // namespace api 640 } // namespace api
641 641
642 } // namespace extensions 642 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698