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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 if (!webstore_data.GetString(kRedirectUrlKey, &redirect_url)) { | 153 if (!webstore_data.GetString(kRedirectUrlKey, &redirect_url)) { |
154 *error = kInvalidWebstoreResponseError; | 154 *error = kInvalidWebstoreResponseError; |
155 return false; | 155 return false; |
156 } | 156 } |
157 web_contents()->OpenURL(content::OpenURLParams( | 157 web_contents()->OpenURL(content::OpenURLParams( |
158 GURL(redirect_url), | 158 GURL(redirect_url), |
159 content::Referrer::SanitizeForRequest( | 159 content::Referrer::SanitizeForRequest( |
160 GURL(redirect_url), | 160 GURL(redirect_url), |
161 content::Referrer(web_contents()->GetURL(), | 161 content::Referrer(web_contents()->GetURL(), |
162 blink::WebReferrerPolicyDefault)), | 162 blink::WebReferrerPolicyDefault)), |
163 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_AUTO_BOOKMARK, false)); | 163 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 164 ui::PAGE_TRANSITION_AUTO_BOOKMARK, false)); |
164 *error = kInlineInstallSupportedError; | 165 *error = kInlineInstallSupportedError; |
165 return false; | 166 return false; |
166 } | 167 } |
167 *error = ""; | 168 *error = ""; |
168 return true; | 169 return true; |
169 } | 170 } |
170 | 171 |
171 bool WebstoreInlineInstaller::CheckRequestorPermitted( | 172 bool WebstoreInlineInstaller::CheckRequestorPermitted( |
172 const base::DictionaryValue& webstore_data, | 173 const base::DictionaryValue& webstore_data, |
173 std::string* error) const { | 174 std::string* error) const { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 DLOG(WARNING) << "Could not parse " << verified_site_pattern_spec << | 236 DLOG(WARNING) << "Could not parse " << verified_site_pattern_spec << |
236 " as URL pattern " << parse_result; | 237 " as URL pattern " << parse_result; |
237 return false; | 238 return false; |
238 } | 239 } |
239 verified_site_pattern.SetScheme("*"); | 240 verified_site_pattern.SetScheme("*"); |
240 | 241 |
241 return verified_site_pattern.MatchesURL(requestor_url); | 242 return verified_site_pattern.MatchesURL(requestor_url); |
242 } | 243 } |
243 | 244 |
244 } // namespace extensions | 245 } // namespace extensions |
OLD | NEW |