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/extension_tab_util.h" | 5 #include "chrome/browser/extensions/extension_tab_util.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_tabs_module_constants.h" | 7 #include "chrome/browser/extensions/extension_tabs_module_constants.h" |
8 #include "chrome/browser/net/url_fixer_upper.h" | 8 #include "chrome/browser/net/url_fixer_upper.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/sessions/restore_tab_helper.h" | 10 #include "chrome/browser/sessions/restore_tab_helper.h" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 *tab_index = i; | 200 *tab_index = i; |
201 return true; | 201 return true; |
202 } | 202 } |
203 } | 203 } |
204 } | 204 } |
205 } | 205 } |
206 return false; | 206 return false; |
207 } | 207 } |
208 | 208 |
209 GURL ExtensionTabUtil::ResolvePossiblyRelativeURL(const std::string& url_string, | 209 GURL ExtensionTabUtil::ResolvePossiblyRelativeURL(const std::string& url_string, |
210 const Extension* extension) { | 210 const extensions::Extension* extension) { |
211 GURL url = GURL(url_string); | 211 GURL url = GURL(url_string); |
212 if (!url.is_valid()) | 212 if (!url.is_valid()) |
213 url = extension->GetResourceURL(url_string); | 213 url = extension->GetResourceURL(url_string); |
214 | 214 |
215 return url; | 215 return url; |
216 } | 216 } |
217 | 217 |
218 bool ExtensionTabUtil::IsCrashURL(const GURL& url) { | 218 bool ExtensionTabUtil::IsCrashURL(const GURL& url) { |
219 // Check a fixed-up URL, to normalize the scheme and parse hosts correctly. | 219 // Check a fixed-up URL, to normalize the scheme and parse hosts correctly. |
220 GURL fixed_url = | 220 GURL fixed_url = |
221 URLFixerUpper::FixupURL(url.possibly_invalid_spec(), std::string()); | 221 URLFixerUpper::FixupURL(url.possibly_invalid_spec(), std::string()); |
222 return (fixed_url.SchemeIs(chrome::kChromeUIScheme) && | 222 return (fixed_url.SchemeIs(chrome::kChromeUIScheme) && |
223 (fixed_url.host() == chrome::kChromeUIBrowserCrashHost || | 223 (fixed_url.host() == chrome::kChromeUIBrowserCrashHost || |
224 fixed_url.host() == chrome::kChromeUICrashHost)); | 224 fixed_url.host() == chrome::kChromeUICrashHost)); |
225 } | 225 } |
OLD | NEW |