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 "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" | 9 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
10 #include "chrome/browser/extensions/chrome_extension_function.h" | 10 #include "chrome/browser/extensions/chrome_extension_function.h" |
11 #include "chrome/browser/extensions/chrome_extension_function_details.h" | 11 #include "chrome/browser/extensions/chrome_extension_function_details.h" |
12 #include "chrome/browser/extensions/tab_helper.h" | 12 #include "chrome/browser/extensions/tab_helper.h" |
13 #include "chrome/browser/extensions/window_controller.h" | 13 #include "chrome/browser/extensions/window_controller.h" |
14 #include "chrome/browser/extensions/window_controller_list.h" | 14 #include "chrome/browser/extensions/window_controller_list.h" |
15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/sessions/session_tab_helper.h" | 16 #include "chrome/browser/sessions/session_tab_helper.h" |
17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
18 #include "chrome/browser/ui/browser_finder.h" | 18 #include "chrome/browser/ui/browser_finder.h" |
19 #include "chrome/browser/ui/browser_iterator.h" | 19 #include "chrome/browser/ui/browser_iterator.h" |
20 #include "chrome/browser/ui/browser_window.h" | 20 #include "chrome/browser/ui/browser_window.h" |
21 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 21 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
22 #include "chrome/browser/ui/singleton_tabs.h" | 22 #include "chrome/browser/ui/singleton_tabs.h" |
23 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" | 23 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" |
24 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 24 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
25 #include "chrome/browser/ui/tabs/tab_utils.h" | 25 #include "chrome/browser/ui/tabs/tab_utils.h" |
26 #include "chrome/common/extensions/api/tabs.h" | 26 #include "chrome/common/extensions/api/tabs.h" |
27 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
28 #include "components/url_fixer/url_fixer.h" | 28 #include "components/url_formatter/url_fixer.h" |
29 #include "content/public/browser/favicon_status.h" | 29 #include "content/public/browser/favicon_status.h" |
30 #include "content/public/browser/navigation_entry.h" | 30 #include "content/public/browser/navigation_entry.h" |
31 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
32 #include "extensions/browser/app_window/app_window.h" | 32 #include "extensions/browser/app_window/app_window.h" |
33 #include "extensions/browser/app_window/app_window_registry.h" | 33 #include "extensions/browser/app_window/app_window_registry.h" |
34 #include "extensions/common/constants.h" | 34 #include "extensions/common/constants.h" |
35 #include "extensions/common/error_utils.h" | 35 #include "extensions/common/error_utils.h" |
36 #include "extensions/common/extension.h" | 36 #include "extensions/common/extension.h" |
37 #include "extensions/common/feature_switch.h" | 37 #include "extensions/common/feature_switch.h" |
38 #include "extensions/common/manifest_constants.h" | 38 #include "extensions/common/manifest_constants.h" |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 chrome::kChromeUICrashHost, | 544 chrome::kChromeUICrashHost, |
545 chrome::kChromeUIHangUIHost, | 545 chrome::kChromeUIHangUIHost, |
546 chrome::kChromeUIKillHost, | 546 chrome::kChromeUIKillHost, |
547 chrome::kChromeUIQuitHost, | 547 chrome::kChromeUIQuitHost, |
548 chrome::kChromeUIRestartHost, | 548 chrome::kChromeUIRestartHost, |
549 content::kChromeUIBrowserCrashHost, | 549 content::kChromeUIBrowserCrashHost, |
550 }; | 550 }; |
551 | 551 |
552 // Check a fixed-up URL, to normalize the scheme and parse hosts correctly. | 552 // Check a fixed-up URL, to normalize the scheme and parse hosts correctly. |
553 GURL fixed_url = | 553 GURL fixed_url = |
554 url_fixer::FixupURL(url.possibly_invalid_spec(), std::string()); | 554 url_formatter::FixupURL(url.possibly_invalid_spec(), std::string()); |
555 if (!fixed_url.SchemeIs(content::kChromeUIScheme)) | 555 if (!fixed_url.SchemeIs(content::kChromeUIScheme)) |
556 return false; | 556 return false; |
557 | 557 |
558 for (size_t i = 0; i < arraysize(kill_hosts); ++i) { | 558 for (size_t i = 0; i < arraysize(kill_hosts); ++i) { |
559 if (fixed_url.host() == kill_hosts[i]) | 559 if (fixed_url.host() == kill_hosts[i]) |
560 return true; | 560 return true; |
561 } | 561 } |
562 | 562 |
563 return false; | 563 return false; |
564 } | 564 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 chrome::ShowSingletonTabOverwritingNTP(browser, params); | 650 chrome::ShowSingletonTabOverwritingNTP(browser, params); |
651 return true; | 651 return true; |
652 } | 652 } |
653 | 653 |
654 // static | 654 // static |
655 bool ExtensionTabUtil::BrowserSupportsTabs(Browser* browser) { | 655 bool ExtensionTabUtil::BrowserSupportsTabs(Browser* browser) { |
656 return browser && browser->tab_strip_model() && !browser->is_devtools(); | 656 return browser && browser->tab_strip_model() && !browser->is_devtools(); |
657 } | 657 } |
658 | 658 |
659 } // namespace extensions | 659 } // namespace extensions |
OLD | NEW |