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

Side by Side Diff: chrome/common/extensions/extension.cc

Issue 1780009: Reland: Link the name of the extension on the management page to the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 7 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/common/extensions/extension.h" 5 #include "chrome/common/extensions/extension.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after
1440 // Although |source| is passed in as a const, it's still possible to modify 1440 // Although |source| is passed in as a const, it's still possible to modify
1441 // it. This is dangerous since the utility process re-uses |source| after 1441 // it. This is dangerous since the utility process re-uses |source| after
1442 // it calls InitFromValue, passing it up to the browser process which calls 1442 // it calls InitFromValue, passing it up to the browser process which calls
1443 // InitFromValue again. As a result, we need to make sure that nobody 1443 // InitFromValue again. As a result, we need to make sure that nobody
1444 // accidentally modifies it. 1444 // accidentally modifies it.
1445 DCHECK(source.Equals(manifest_value_.get())); 1445 DCHECK(source.Equals(manifest_value_.get()));
1446 1446
1447 return true; 1447 return true;
1448 } 1448 }
1449 1449
1450 GURL Extension::GalleryUrl() const {
1451 if (!update_url_.DomainIs("google.com"))
1452 return GURL();
1453
1454 GURL url(std::string(extension_urls::kGalleryBrowsePrefix) +
1455 std::string("/detail/") + id_);
1456
1457 return url;
1458 }
1459
1450 std::set<FilePath> Extension::GetBrowserImages() { 1460 std::set<FilePath> Extension::GetBrowserImages() {
1451 std::set<FilePath> image_paths; 1461 std::set<FilePath> image_paths;
1452 1462
1453 // extension icons 1463 // Extension icons.
1454 for (std::map<int, std::string>::iterator iter = icons_.begin(); 1464 for (std::map<int, std::string>::iterator iter = icons_.begin();
1455 iter != icons_.end(); ++iter) { 1465 iter != icons_.end(); ++iter) {
1456 image_paths.insert(FilePath::FromWStringHack(UTF8ToWide(iter->second))); 1466 image_paths.insert(FilePath::FromWStringHack(UTF8ToWide(iter->second)));
1457 } 1467 }
1458 1468
1459 // theme images 1469 // Theme images.
1460 DictionaryValue* theme_images = GetThemeImages(); 1470 DictionaryValue* theme_images = GetThemeImages();
1461 if (theme_images) { 1471 if (theme_images) {
1462 for (DictionaryValue::key_iterator it = theme_images->begin_keys(); 1472 for (DictionaryValue::key_iterator it = theme_images->begin_keys();
1463 it != theme_images->end_keys(); ++it) { 1473 it != theme_images->end_keys(); ++it) {
1464 std::wstring val; 1474 std::wstring val;
1465 if (theme_images->GetStringWithoutPathExpansion(*it, &val)) 1475 if (theme_images->GetStringWithoutPathExpansion(*it, &val))
1466 image_paths.insert(FilePath::FromWStringHack(val)); 1476 image_paths.insert(FilePath::FromWStringHack(val));
1467 } 1477 }
1468 } 1478 }
1469 1479
1470 // page action icons 1480 // Page action icons.
1471 if (page_action_.get()) { 1481 if (page_action_.get()) {
1472 std::vector<std::string>* icon_paths = page_action_->icon_paths(); 1482 std::vector<std::string>* icon_paths = page_action_->icon_paths();
1473 for (std::vector<std::string>::iterator iter = icon_paths->begin(); 1483 for (std::vector<std::string>::iterator iter = icon_paths->begin();
1474 iter != icon_paths->end(); ++iter) { 1484 iter != icon_paths->end(); ++iter) {
1475 image_paths.insert(FilePath::FromWStringHack(UTF8ToWide(*iter))); 1485 image_paths.insert(FilePath::FromWStringHack(UTF8ToWide(*iter)));
1476 } 1486 }
1477 } 1487 }
1478 1488
1479 // browser action icons 1489 // Browser action icons.
1480 if (browser_action_.get()) { 1490 if (browser_action_.get()) {
1481 std::vector<std::string>* icon_paths = browser_action_->icon_paths(); 1491 std::vector<std::string>* icon_paths = browser_action_->icon_paths();
1482 for (std::vector<std::string>::iterator iter = icon_paths->begin(); 1492 for (std::vector<std::string>::iterator iter = icon_paths->begin();
1483 iter != icon_paths->end(); ++iter) { 1493 iter != icon_paths->end(); ++iter) {
1484 image_paths.insert(FilePath::FromWStringHack(UTF8ToWide(*iter))); 1494 image_paths.insert(FilePath::FromWStringHack(UTF8ToWide(*iter)));
1485 } 1495 }
1486 } 1496 }
1487 1497
1488 return image_paths; 1498 return image_paths;
1489 } 1499 }
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 } else { 1651 } else {
1642 return false; 1652 return false;
1643 } 1653 }
1644 } else { 1654 } else {
1645 return true; 1655 return true;
1646 } 1656 }
1647 } 1657 }
1648 } 1658 }
1649 return false; 1659 return false;
1650 } 1660 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698