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 "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
10 | 10 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 if (inline_install_not_supported) { | 96 if (inline_install_not_supported) { |
97 std::string redirect_url; | 97 std::string redirect_url; |
98 if (!webstore_data.GetString(kRedirectUrlKey, &redirect_url)) { | 98 if (!webstore_data.GetString(kRedirectUrlKey, &redirect_url)) { |
99 *error = kInvalidWebstoreResponseError; | 99 *error = kInvalidWebstoreResponseError; |
100 return false; | 100 return false; |
101 } | 101 } |
102 web_contents()->OpenURL( | 102 web_contents()->OpenURL( |
103 content::OpenURLParams( | 103 content::OpenURLParams( |
104 GURL(redirect_url), | 104 GURL(redirect_url), |
105 content::Referrer(web_contents()->GetURL(), | 105 content::Referrer(web_contents()->GetURL(), |
106 WebKit::WebReferrerPolicyDefault), | 106 blink::WebReferrerPolicyDefault), |
107 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_AUTO_BOOKMARK, false)); | 107 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_AUTO_BOOKMARK, false)); |
108 *error = kInlineInstallSupportedError; | 108 *error = kInlineInstallSupportedError; |
109 return false; | 109 return false; |
110 } | 110 } |
111 | 111 |
112 *error = ""; | 112 *error = ""; |
113 return true; | 113 return true; |
114 } | 114 } |
115 | 115 |
116 bool WebstoreInlineInstaller::CheckRequestorPermitted( | 116 bool WebstoreInlineInstaller::CheckRequestorPermitted( |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 DLOG(WARNING) << "Could not parse " << verified_site_pattern_spec << | 212 DLOG(WARNING) << "Could not parse " << verified_site_pattern_spec << |
213 " as URL pattern " << parse_result; | 213 " as URL pattern " << parse_result; |
214 return false; | 214 return false; |
215 } | 215 } |
216 verified_site_pattern.SetScheme("*"); | 216 verified_site_pattern.SetScheme("*"); |
217 | 217 |
218 return verified_site_pattern.MatchesURL(requestor_url); | 218 return verified_site_pattern.MatchesURL(requestor_url); |
219 } | 219 } |
220 | 220 |
221 } // namespace extensions | 221 } // namespace extensions |
OLD | NEW |