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

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

Issue 313203004: Make ExtensionInstallPrompt::Prompt ref-counted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest master for CQ Created 6 years, 6 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/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
(...skipping 29 matching lines...) Expand all
40 40
41 bool WebstoreInlineInstaller::CheckRequestorAlive() const { 41 bool WebstoreInlineInstaller::CheckRequestorAlive() const {
42 // The tab may have gone away - cancel installation in that case. 42 // The tab may have gone away - cancel installation in that case.
43 return web_contents() != NULL; 43 return web_contents() != NULL;
44 } 44 }
45 45
46 const GURL& WebstoreInlineInstaller::GetRequestorURL() const { 46 const GURL& WebstoreInlineInstaller::GetRequestorURL() const {
47 return requestor_url_; 47 return requestor_url_;
48 } 48 }
49 49
50 scoped_ptr<ExtensionInstallPrompt::Prompt> 50 scoped_refptr<ExtensionInstallPrompt::Prompt>
51 WebstoreInlineInstaller::CreateInstallPrompt() const { 51 WebstoreInlineInstaller::CreateInstallPrompt() const {
52 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt( 52 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt(
53 new ExtensionInstallPrompt::Prompt( 53 new ExtensionInstallPrompt::Prompt(
54 ExtensionInstallPrompt::INLINE_INSTALL_PROMPT)); 54 ExtensionInstallPrompt::INLINE_INSTALL_PROMPT));
55 55
56 // 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
57 // 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
58 // (intentionally), which means that it's unlikely to be correct. 58 // (intentionally), which means that it's unlikely to be correct.
59 prompt->SetWebstoreData(localized_user_count(), 59 prompt->SetWebstoreData(localized_user_count(),
60 show_user_count(), 60 show_user_count(),
61 average_rating(), 61 average_rating(),
62 rating_count()); 62 rating_count());
63 return prompt.Pass(); 63 return prompt;
64 } 64 }
65 65
66 bool WebstoreInlineInstaller::ShouldShowPostInstallUI() const { 66 bool WebstoreInlineInstaller::ShouldShowPostInstallUI() const {
67 return true; 67 return true;
68 } 68 }
69 69
70 bool WebstoreInlineInstaller::ShouldShowAppInstalledBubble() const { 70 bool WebstoreInlineInstaller::ShouldShowAppInstalledBubble() const {
71 return true; 71 return true;
72 } 72 }
73 73
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 DLOG(WARNING) << "Could not parse " << verified_site_pattern_spec << 206 DLOG(WARNING) << "Could not parse " << verified_site_pattern_spec <<
207 " as URL pattern " << parse_result; 207 " as URL pattern " << parse_result;
208 return false; 208 return false;
209 } 209 }
210 verified_site_pattern.SetScheme("*"); 210 verified_site_pattern.SetScheme("*");
211 211
212 return verified_site_pattern.MatchesURL(requestor_url); 212 return verified_site_pattern.MatchesURL(requestor_url);
213 } 213 }
214 214
215 } // namespace extensions 215 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698