OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |