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

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

Issue 145153002: Make sideloaded (externally installed) extensions display webstore info (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ChromeOS fix Created 6 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
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/webstore_inline_installer.h" 5 #include "chrome/browser/extensions/webstore_inline_installer.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents.h"
10 10
11 using content::WebContents; 11 using content::WebContents;
12 12
13 namespace extensions { 13 namespace extensions {
14 14
15 const char kVerifiedSiteKey[] = "verified_site";
16 const char kVerifiedSitesKey[] = "verified_sites";
17 const char kInlineInstallNotSupportedKey[] = "inline_install_not_supported";
18 const char kRedirectUrlKey[] = "redirect_url";
19
20 const char kInvalidWebstoreResponseError[] = "Invalid Chrome Web Store reponse"; 15 const char kInvalidWebstoreResponseError[] = "Invalid Chrome Web Store reponse";
21 const char kNoVerifiedSitesError[] = 16 const char kNoVerifiedSitesError[] =
22 "Inline installs can only be initiated for Chrome Web Store items that " 17 "Inline installs can only be initiated for Chrome Web Store items that "
23 "have one or more verified sites"; 18 "have one or more verified sites";
24 const char kNotFromVerifiedSitesError[] = 19 const char kNotFromVerifiedSitesError[] =
25 "Installs can only be initiated by one of the Chrome Web Store item's " 20 "Installs can only be initiated by one of the Chrome Web Store item's "
26 "verified sites"; 21 "verified sites";
27 const char kInlineInstallSupportedError[] = 22 const char kInlineInstallSupportedError[] =
28 "Inline installation is not supported for this item. The user will be " 23 "Inline installation is not supported for this item. The user will be "
29 "redirected to the Chrome Web Store."; 24 "redirected to the Chrome Web Store.";
(...skipping 24 matching lines...) Expand all
54 49
55 scoped_ptr<ExtensionInstallPrompt::Prompt> 50 scoped_ptr<ExtensionInstallPrompt::Prompt>
56 WebstoreInlineInstaller::CreateInstallPrompt() const { 51 WebstoreInlineInstaller::CreateInstallPrompt() const {
57 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt( 52 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt(
58 new ExtensionInstallPrompt::Prompt( 53 new ExtensionInstallPrompt::Prompt(
59 ExtensionInstallPrompt::INLINE_INSTALL_PROMPT)); 54 ExtensionInstallPrompt::INLINE_INSTALL_PROMPT));
60 55
61 // crbug.com/260742: Don't display the user count if it's zero. The reason 56 // crbug.com/260742: Don't display the user count if it's zero. The reason
62 // it's zero is very often that the number isn't actually being counted 57 // it's zero is very often that the number isn't actually being counted
63 // (intentionally), which means that it's unlikely to be correct. 58 // (intentionally), which means that it's unlikely to be correct.
64 prompt->SetInlineInstallWebstoreData(localized_user_count(), 59 prompt->SetWebstoreData(localized_user_count(),
65 show_user_count(), 60 show_user_count(),
66 average_rating(), 61 average_rating(),
67 rating_count()); 62 rating_count());
68 return prompt.Pass(); 63 return prompt.Pass();
69 } 64 }
70 65
71 bool WebstoreInlineInstaller::ShouldShowPostInstallUI() const { 66 bool WebstoreInlineInstaller::ShouldShowPostInstallUI() const {
72 return true; 67 return true;
73 } 68 }
74 69
75 bool WebstoreInlineInstaller::ShouldShowAppInstalledBubble() const { 70 bool WebstoreInlineInstaller::ShouldShowAppInstalledBubble() const {
76 return true; 71 return true;
77 } 72 }
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 DLOG(WARNING) << "Could not parse " << verified_site_pattern_spec << 207 DLOG(WARNING) << "Could not parse " << verified_site_pattern_spec <<
213 " as URL pattern " << parse_result; 208 " as URL pattern " << parse_result;
214 return false; 209 return false;
215 } 210 }
216 verified_site_pattern.SetScheme("*"); 211 verified_site_pattern.SetScheme("*");
217 212
218 return verified_site_pattern.MatchesURL(requestor_url); 213 return verified_site_pattern.MatchesURL(requestor_url);
219 } 214 }
220 215
221 } // namespace extensions 216 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698