| 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/api/tabs/tabs_constants.h" | 7 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
| 8 #include "chrome/browser/extensions/shell_window_registry.h" | 8 #include "chrome/browser/extensions/shell_window_registry.h" |
| 9 #include "chrome/browser/extensions/tab_helper.h" | 9 #include "chrome/browser/extensions/tab_helper.h" |
| 10 #include "chrome/browser/extensions/window_controller.h" | 10 #include "chrome/browser/extensions/window_controller.h" |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 url = extension->GetResourceURL(url_string); | 264 url = extension->GetResourceURL(url_string); |
| 265 | 265 |
| 266 return url; | 266 return url; |
| 267 } | 267 } |
| 268 | 268 |
| 269 bool ExtensionTabUtil::IsCrashURL(const GURL& url) { | 269 bool ExtensionTabUtil::IsCrashURL(const GURL& url) { |
| 270 // Check a fixed-up URL, to normalize the scheme and parse hosts correctly. | 270 // Check a fixed-up URL, to normalize the scheme and parse hosts correctly. |
| 271 GURL fixed_url = | 271 GURL fixed_url = |
| 272 URLFixerUpper::FixupURL(url.possibly_invalid_spec(), std::string()); | 272 URLFixerUpper::FixupURL(url.possibly_invalid_spec(), std::string()); |
| 273 return (fixed_url.SchemeIs(chrome::kChromeUIScheme) && | 273 return (fixed_url.SchemeIs(chrome::kChromeUIScheme) && |
| 274 (fixed_url.host() == chrome::kChromeUIBrowserCrashHost || | 274 (fixed_url.host() == content::kChromeUIBrowserCrashHost || |
| 275 fixed_url.host() == chrome::kChromeUICrashHost)); | 275 fixed_url.host() == chrome::kChromeUICrashHost)); |
| 276 } | 276 } |
| 277 | 277 |
| 278 void ExtensionTabUtil::CreateTab(WebContents* web_contents, | 278 void ExtensionTabUtil::CreateTab(WebContents* web_contents, |
| 279 const std::string& extension_id, | 279 const std::string& extension_id, |
| 280 WindowOpenDisposition disposition, | 280 WindowOpenDisposition disposition, |
| 281 const gfx::Rect& initial_pos, | 281 const gfx::Rect& initial_pos, |
| 282 bool user_gesture) { | 282 bool user_gesture) { |
| 283 Profile* profile = | 283 Profile* profile = |
| 284 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 284 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 content::OpenURLParams params( | 339 content::OpenURLParams params( |
| 340 extensions::ManifestURL::GetOptionsPage(extension), | 340 extensions::ManifestURL::GetOptionsPage(extension), |
| 341 content::Referrer(), SINGLETON_TAB, | 341 content::Referrer(), SINGLETON_TAB, |
| 342 content::PAGE_TRANSITION_LINK, false); | 342 content::PAGE_TRANSITION_LINK, false); |
| 343 browser->OpenURL(params); | 343 browser->OpenURL(params); |
| 344 browser->window()->Show(); | 344 browser->window()->Show(); |
| 345 WebContents* web_contents = | 345 WebContents* web_contents = |
| 346 browser->tab_strip_model()->GetActiveWebContents(); | 346 browser->tab_strip_model()->GetActiveWebContents(); |
| 347 web_contents->GetDelegate()->ActivateContents(web_contents); | 347 web_contents->GetDelegate()->ActivateContents(web_contents); |
| 348 } | 348 } |
| OLD | NEW |