| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 return false; | 151 return false; |
| 152 } | 152 } |
| 153 *error = ""; | 153 *error = ""; |
| 154 return true; | 154 return true; |
| 155 } | 155 } |
| 156 | 156 |
| 157 // | 157 // |
| 158 // Private implementation. | 158 // Private implementation. |
| 159 // | 159 // |
| 160 | 160 |
| 161 void WebstoreInlineInstaller::WebContentsDestroyed( | 161 void WebstoreInlineInstaller::WebContentsDestroyed() { |
| 162 content::WebContents* web_contents) { | |
| 163 AbortInstall(); | 162 AbortInstall(); |
| 164 } | 163 } |
| 165 | 164 |
| 166 // static | 165 // static |
| 167 bool WebstoreInlineInstaller::IsRequestorURLInVerifiedSite( | 166 bool WebstoreInlineInstaller::IsRequestorURLInVerifiedSite( |
| 168 const GURL& requestor_url, | 167 const GURL& requestor_url, |
| 169 const std::string& verified_site) { | 168 const std::string& verified_site) { |
| 170 // Turn the verified site into a URL that can be parsed by URLPattern. | 169 // Turn the verified site into a URL that can be parsed by URLPattern. |
| 171 // |verified_site| must follow the format: | 170 // |verified_site| must follow the format: |
| 172 // | 171 // |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 DLOG(WARNING) << "Could not parse " << verified_site_pattern_spec << | 206 DLOG(WARNING) << "Could not parse " << verified_site_pattern_spec << |
| 208 " as URL pattern " << parse_result; | 207 " as URL pattern " << parse_result; |
| 209 return false; | 208 return false; |
| 210 } | 209 } |
| 211 verified_site_pattern.SetScheme("*"); | 210 verified_site_pattern.SetScheme("*"); |
| 212 | 211 |
| 213 return verified_site_pattern.MatchesURL(requestor_url); | 212 return verified_site_pattern.MatchesURL(requestor_url); |
| 214 } | 213 } |
| 215 | 214 |
| 216 } // namespace extensions | 215 } // namespace extensions |
| OLD | NEW |