| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 | 543 |
| 544 return url; | 544 return url; |
| 545 } | 545 } |
| 546 | 546 |
| 547 bool ExtensionTabUtil::IsKillURL(const GURL& url) { | 547 bool ExtensionTabUtil::IsKillURL(const GURL& url) { |
| 548 static const char* kill_hosts[] = { | 548 static const char* kill_hosts[] = { |
| 549 chrome::kChromeUICrashHost, | 549 chrome::kChromeUICrashHost, |
| 550 chrome::kChromeUIDelayedHangUIHost, | 550 chrome::kChromeUIDelayedHangUIHost, |
| 551 chrome::kChromeUIHangUIHost, | 551 chrome::kChromeUIHangUIHost, |
| 552 chrome::kChromeUIKillHost, | 552 chrome::kChromeUIKillHost, |
| 553 chrome::kChromeUIMemoryExhaustHost, |
| 553 chrome::kChromeUIQuitHost, | 554 chrome::kChromeUIQuitHost, |
| 554 chrome::kChromeUIRestartHost, | 555 chrome::kChromeUIRestartHost, |
| 555 content::kChromeUIBrowserCrashHost, | 556 content::kChromeUIBrowserCrashHost, |
| 556 }; | 557 }; |
| 557 | 558 |
| 558 // Check a fixed-up URL, to normalize the scheme and parse hosts correctly. | 559 // Check a fixed-up URL, to normalize the scheme and parse hosts correctly. |
| 559 GURL fixed_url = | 560 GURL fixed_url = |
| 560 url_formatter::FixupURL(url.possibly_invalid_spec(), std::string()); | 561 url_formatter::FixupURL(url.possibly_invalid_spec(), std::string()); |
| 561 if (!fixed_url.SchemeIs(content::kChromeUIScheme)) | 562 if (!fixed_url.SchemeIs(content::kChromeUIScheme)) |
| 562 return false; | 563 return false; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 chrome::ShowSingletonTabOverwritingNTP(browser, params); | 664 chrome::ShowSingletonTabOverwritingNTP(browser, params); |
| 664 return true; | 665 return true; |
| 665 } | 666 } |
| 666 | 667 |
| 667 // static | 668 // static |
| 668 bool ExtensionTabUtil::BrowserSupportsTabs(Browser* browser) { | 669 bool ExtensionTabUtil::BrowserSupportsTabs(Browser* browser) { |
| 669 return browser && browser->tab_strip_model() && !browser->is_devtools(); | 670 return browser && browser->tab_strip_model() && !browser->is_devtools(); |
| 670 } | 671 } |
| 671 | 672 |
| 672 } // namespace extensions | 673 } // namespace extensions |
| OLD | NEW |