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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 std::string redirect_url; | 92 std::string redirect_url; |
93 if (!webstore_data.GetString(kRedirectUrlKey, &redirect_url)) { | 93 if (!webstore_data.GetString(kRedirectUrlKey, &redirect_url)) { |
94 *error = kInvalidWebstoreResponseError; | 94 *error = kInvalidWebstoreResponseError; |
95 return false; | 95 return false; |
96 } | 96 } |
97 web_contents()->OpenURL( | 97 web_contents()->OpenURL( |
98 content::OpenURLParams( | 98 content::OpenURLParams( |
99 GURL(redirect_url), | 99 GURL(redirect_url), |
100 content::Referrer(web_contents()->GetURL(), | 100 content::Referrer(web_contents()->GetURL(), |
101 blink::WebReferrerPolicyDefault), | 101 blink::WebReferrerPolicyDefault), |
102 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_AUTO_BOOKMARK, false)); | 102 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_AUTO_BOOKMARK, false)); |
103 *error = kInlineInstallSupportedError; | 103 *error = kInlineInstallSupportedError; |
104 return false; | 104 return false; |
105 } | 105 } |
106 | 106 |
107 *error = ""; | 107 *error = ""; |
108 return true; | 108 return true; |
109 } | 109 } |
110 | 110 |
111 bool WebstoreInlineInstaller::CheckRequestorPermitted( | 111 bool WebstoreInlineInstaller::CheckRequestorPermitted( |
112 const base::DictionaryValue& webstore_data, | 112 const base::DictionaryValue& webstore_data, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |