| 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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 | 549 |
| 550 return url; | 550 return url; |
| 551 } | 551 } |
| 552 | 552 |
| 553 bool ExtensionTabUtil::IsKillURL(const GURL& url) { | 553 bool ExtensionTabUtil::IsKillURL(const GURL& url) { |
| 554 static const char* kill_hosts[] = { | 554 static const char* kill_hosts[] = { |
| 555 chrome::kChromeUICrashHost, | 555 chrome::kChromeUICrashHost, |
| 556 chrome::kChromeUIDelayedHangUIHost, | 556 chrome::kChromeUIDelayedHangUIHost, |
| 557 chrome::kChromeUIHangUIHost, | 557 chrome::kChromeUIHangUIHost, |
| 558 chrome::kChromeUIKillHost, | 558 chrome::kChromeUIKillHost, |
| 559 chrome::kChromeUIMemoryExhaustHost, |
| 559 chrome::kChromeUIQuitHost, | 560 chrome::kChromeUIQuitHost, |
| 560 chrome::kChromeUIRestartHost, | 561 chrome::kChromeUIRestartHost, |
| 561 content::kChromeUIBrowserCrashHost, | 562 content::kChromeUIBrowserCrashHost, |
| 562 }; | 563 }; |
| 563 | 564 |
| 564 // Check a fixed-up URL, to normalize the scheme and parse hosts correctly. | 565 // Check a fixed-up URL, to normalize the scheme and parse hosts correctly. |
| 565 GURL fixed_url = | 566 GURL fixed_url = |
| 566 url_formatter::FixupURL(url.possibly_invalid_spec(), std::string()); | 567 url_formatter::FixupURL(url.possibly_invalid_spec(), std::string()); |
| 567 if (!fixed_url.SchemeIs(content::kChromeUIScheme)) | 568 if (!fixed_url.SchemeIs(content::kChromeUIScheme)) |
| 568 return false; | 569 return false; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 chrome::ShowSingletonTabOverwritingNTP(browser, params); | 670 chrome::ShowSingletonTabOverwritingNTP(browser, params); |
| 670 return true; | 671 return true; |
| 671 } | 672 } |
| 672 | 673 |
| 673 // static | 674 // static |
| 674 bool ExtensionTabUtil::BrowserSupportsTabs(Browser* browser) { | 675 bool ExtensionTabUtil::BrowserSupportsTabs(Browser* browser) { |
| 675 return browser && browser->tab_strip_model() && !browser->is_devtools(); | 676 return browser && browser->tab_strip_model() && !browser->is_devtools(); |
| 676 } | 677 } |
| 677 | 678 |
| 678 } // namespace extensions | 679 } // namespace extensions |
| OLD | NEW |