| OLD | NEW |
| 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 "chrome/browser/ui/browser_finder.h" | 9 #include "chrome/browser/ui/browser_finder.h" |
| 10 #include "content/public/browser/navigation_details.h" | 10 #include "content/public/browser/navigation_details.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 bool WebstoreInlineInstaller::CheckRequestorAlive() const { | 95 bool WebstoreInlineInstaller::CheckRequestorAlive() const { |
| 96 // The frame or tab may have gone away - cancel installation in that case. | 96 // The frame or tab may have gone away - cancel installation in that case. |
| 97 return host_ != nullptr && web_contents() != nullptr; | 97 return host_ != nullptr && web_contents() != nullptr; |
| 98 } | 98 } |
| 99 | 99 |
| 100 const GURL& WebstoreInlineInstaller::GetRequestorURL() const { | 100 const GURL& WebstoreInlineInstaller::GetRequestorURL() const { |
| 101 return requestor_url_; | 101 return requestor_url_; |
| 102 } | 102 } |
| 103 | 103 |
| 104 scoped_ptr<ExtensionInstallPrompt::Prompt> | 104 std::unique_ptr<ExtensionInstallPrompt::Prompt> |
| 105 WebstoreInlineInstaller::CreateInstallPrompt() const { | 105 WebstoreInlineInstaller::CreateInstallPrompt() const { |
| 106 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt( | 106 std::unique_ptr<ExtensionInstallPrompt::Prompt> prompt( |
| 107 new ExtensionInstallPrompt::Prompt( | 107 new ExtensionInstallPrompt::Prompt( |
| 108 ExtensionInstallPrompt::INLINE_INSTALL_PROMPT)); | 108 ExtensionInstallPrompt::INLINE_INSTALL_PROMPT)); |
| 109 | 109 |
| 110 // crbug.com/260742: Don't display the user count if it's zero. The reason | 110 // crbug.com/260742: Don't display the user count if it's zero. The reason |
| 111 // it's zero is very often that the number isn't actually being counted | 111 // it's zero is very often that the number isn't actually being counted |
| 112 // (intentionally), which means that it's unlikely to be correct. | 112 // (intentionally), which means that it's unlikely to be correct. |
| 113 prompt->SetWebstoreData(localized_user_count(), | 113 prompt->SetWebstoreData(localized_user_count(), |
| 114 show_user_count(), | 114 show_user_count(), |
| 115 average_rating(), | 115 average_rating(), |
| 116 rating_count()); | 116 rating_count()); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 DLOG(WARNING) << "Could not parse " << verified_site_pattern_spec << | 235 DLOG(WARNING) << "Could not parse " << verified_site_pattern_spec << |
| 236 " as URL pattern " << parse_result; | 236 " as URL pattern " << parse_result; |
| 237 return false; | 237 return false; |
| 238 } | 238 } |
| 239 verified_site_pattern.SetScheme("*"); | 239 verified_site_pattern.SetScheme("*"); |
| 240 | 240 |
| 241 return verified_site_pattern.MatchesURL(requestor_url); | 241 return verified_site_pattern.MatchesURL(requestor_url); |
| 242 } | 242 } |
| 243 | 243 |
| 244 } // namespace extensions | 244 } // namespace extensions |
| OLD | NEW |