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

Side by Side Diff: chrome/browser/extensions/extension_webstore_private_api.cc

Issue 8827013: Move/replace/rename URL-based extension getters from ExtensionService to/in ExtensionSet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: id Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/extension_webstore_private_api.h" 5 #include "chrome/browser/extensions/extension_webstore_private_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 return profile->GetProfileSyncService(); 65 return profile->GetProfileSyncService();
66 } 66 }
67 67
68 bool IsWebStoreURL(Profile* profile, const GURL& url) { 68 bool IsWebStoreURL(Profile* profile, const GURL& url) {
69 ExtensionService* service = profile->GetExtensionService(); 69 ExtensionService* service = profile->GetExtensionService();
70 const Extension* store = service->GetWebStoreApp(); 70 const Extension* store = service->GetWebStoreApp();
71 if (!store) { 71 if (!store) {
72 NOTREACHED(); 72 NOTREACHED();
73 return false; 73 return false;
74 } 74 }
75 return (service->GetExtensionByWebExtent(url) == store); 75 return (service->extensions()->GetHostedAppByURL(ExtensionURLInfo(url)) ==
76 store);
76 } 77 }
77 78
78 // Whitelists extension IDs for use by webstorePrivate.silentlyInstall. 79 // Whitelists extension IDs for use by webstorePrivate.silentlyInstall.
79 bool trust_test_ids = false; 80 bool trust_test_ids = false;
80 81
81 bool IsTrustedForSilentInstall(const std::string& id) { 82 bool IsTrustedForSilentInstall(const std::string& id) {
82 // Trust the extensions in api_test/webstore_private/bundle when the flag 83 // Trust the extensions in api_test/webstore_private/bundle when the flag
83 // is set. 84 // is set.
84 if (trust_test_ids && 85 if (trust_test_ids &&
85 (id == "begfmnajjkbjdgmffnjaojchoncnmngg" || 86 (id == "begfmnajjkbjdgmffnjaojchoncnmngg" ||
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 } else { 548 } else {
548 // Matched with a Release in OnGpuInfoUpdate. 549 // Matched with a Release in OnGpuInfoUpdate.
549 AddRef(); 550 AddRef();
550 551
551 manager->AddObserver(this); 552 manager->AddObserver(this);
552 manager->RequestCompleteGpuInfoIfNeeded(); 553 manager->RequestCompleteGpuInfoIfNeeded();
553 } 554 }
554 return true; 555 return true;
555 } 556 }
556 557
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_web_ui.cc ('k') | chrome/browser/geolocation/chrome_geolocation_permission_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698