| 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 url = extension->GetResourceURL(url_string); | 263 url = extension->GetResourceURL(url_string); |
| 264 | 264 |
| 265 return url; | 265 return url; |
| 266 } | 266 } |
| 267 | 267 |
| 268 bool ExtensionTabUtil::IsCrashURL(const GURL& url) { | 268 bool ExtensionTabUtil::IsCrashURL(const GURL& url) { |
| 269 // Check a fixed-up URL, to normalize the scheme and parse hosts correctly. | 269 // Check a fixed-up URL, to normalize the scheme and parse hosts correctly. |
| 270 GURL fixed_url = | 270 GURL fixed_url = |
| 271 URLFixerUpper::FixupURL(url.possibly_invalid_spec(), std::string()); | 271 URLFixerUpper::FixupURL(url.possibly_invalid_spec(), std::string()); |
| 272 return (fixed_url.SchemeIs(chrome::kChromeUIScheme) && | 272 return (fixed_url.SchemeIs(chrome::kChromeUIScheme) && |
| 273 (fixed_url.host() == chrome::kChromeUIBrowserCrashHost || | 273 (fixed_url.host() == content::kChromeUIBrowserCrashHost || |
| 274 fixed_url.host() == chrome::kChromeUICrashHost)); | 274 fixed_url.host() == chrome::kChromeUICrashHost)); |
| 275 } | 275 } |
| 276 | 276 |
| 277 void ExtensionTabUtil::CreateTab(WebContents* web_contents, | 277 void ExtensionTabUtil::CreateTab(WebContents* web_contents, |
| 278 const std::string& extension_id, | 278 const std::string& extension_id, |
| 279 WindowOpenDisposition disposition, | 279 WindowOpenDisposition disposition, |
| 280 const gfx::Rect& initial_pos, | 280 const gfx::Rect& initial_pos, |
| 281 bool user_gesture) { | 281 bool user_gesture) { |
| 282 Profile* profile = | 282 Profile* profile = |
| 283 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 283 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 | 316 |
| 317 // static | 317 // static |
| 318 extensions::WindowController* ExtensionTabUtil::GetWindowControllerOfTab( | 318 extensions::WindowController* ExtensionTabUtil::GetWindowControllerOfTab( |
| 319 const WebContents* web_contents) { | 319 const WebContents* web_contents) { |
| 320 Browser* browser = chrome::FindBrowserWithWebContents(web_contents); | 320 Browser* browser = chrome::FindBrowserWithWebContents(web_contents); |
| 321 if (browser != NULL) | 321 if (browser != NULL) |
| 322 return browser->extension_window_controller(); | 322 return browser->extension_window_controller(); |
| 323 | 323 |
| 324 return NULL; | 324 return NULL; |
| 325 } | 325 } |
| OLD | NEW |