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/api/tabs/tabs_api.h" | 5 #include "chrome/browser/extensions/api/tabs/tabs_api.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <limits> | 9 #include <limits> |
10 #include <memory> | 10 #include <memory> |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "base/threading/thread_task_runner_handle.h" | 28 #include "base/threading/thread_task_runner_handle.h" |
29 #include "chrome/browser/browser_process.h" | 29 #include "chrome/browser/browser_process.h" |
30 #include "chrome/browser/chrome_notification_types.h" | 30 #include "chrome/browser/chrome_notification_types.h" |
31 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" | 31 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
32 #include "chrome/browser/extensions/api/tabs/windows_util.h" | 32 #include "chrome/browser/extensions/api/tabs/windows_util.h" |
33 #include "chrome/browser/extensions/extension_service.h" | 33 #include "chrome/browser/extensions/extension_service.h" |
34 #include "chrome/browser/extensions/extension_tab_util.h" | 34 #include "chrome/browser/extensions/extension_tab_util.h" |
35 #include "chrome/browser/extensions/tab_helper.h" | 35 #include "chrome/browser/extensions/tab_helper.h" |
36 #include "chrome/browser/extensions/window_controller.h" | 36 #include "chrome/browser/extensions/window_controller.h" |
37 #include "chrome/browser/extensions/window_controller_list.h" | 37 #include "chrome/browser/extensions/window_controller_list.h" |
38 #include "chrome/browser/memory/tab_manager.h" | |
39 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 38 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
40 #include "chrome/browser/profiles/profile.h" | 39 #include "chrome/browser/profiles/profile.h" |
| 40 #include "chrome/browser/resource_coordinator/tab_manager.h" |
41 #include "chrome/browser/sessions/session_tab_helper.h" | 41 #include "chrome/browser/sessions/session_tab_helper.h" |
42 #include "chrome/browser/translate/chrome_translate_client.h" | 42 #include "chrome/browser/translate/chrome_translate_client.h" |
43 #include "chrome/browser/ui/apps/chrome_app_delegate.h" | 43 #include "chrome/browser/ui/apps/chrome_app_delegate.h" |
44 #include "chrome/browser/ui/browser.h" | 44 #include "chrome/browser/ui/browser.h" |
45 #include "chrome/browser/ui/browser_commands.h" | 45 #include "chrome/browser/ui/browser_commands.h" |
46 #include "chrome/browser/ui/browser_finder.h" | 46 #include "chrome/browser/ui/browser_finder.h" |
47 #include "chrome/browser/ui/browser_list.h" | 47 #include "chrome/browser/ui/browser_list.h" |
48 #include "chrome/browser/ui/browser_navigator.h" | 48 #include "chrome/browser/ui/browser_navigator.h" |
49 #include "chrome/browser/ui/browser_navigator_params.h" | 49 #include "chrome/browser/ui/browser_navigator_params.h" |
50 #include "chrome/browser/ui/browser_window.h" | 50 #include "chrome/browser/ui/browser_window.h" |
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 | 876 |
877 if (!window_type.empty() && | 877 if (!window_type.empty() && |
878 window_type != | 878 window_type != |
879 browser->extension_window_controller()->GetWindowTypeText()) { | 879 browser->extension_window_controller()->GetWindowTypeText()) { |
880 continue; | 880 continue; |
881 } | 881 } |
882 | 882 |
883 TabStripModel* tab_strip = browser->tab_strip_model(); | 883 TabStripModel* tab_strip = browser->tab_strip_model(); |
884 for (int i = 0; i < tab_strip->count(); ++i) { | 884 for (int i = 0; i < tab_strip->count(); ++i) { |
885 WebContents* web_contents = tab_strip->GetWebContentsAt(i); | 885 WebContents* web_contents = tab_strip->GetWebContentsAt(i); |
886 memory::TabManager* tab_manager = g_browser_process->GetTabManager(); | 886 resource_coordinator::TabManager* tab_manager = |
| 887 g_browser_process->GetTabManager(); |
887 | 888 |
888 if (index > -1 && i != index) | 889 if (index > -1 && i != index) |
889 continue; | 890 continue; |
890 | 891 |
891 if (!web_contents) { | 892 if (!web_contents) { |
892 continue; | 893 continue; |
893 } | 894 } |
894 | 895 |
895 if (!MatchesBool(params->query_info.highlighted.get(), | 896 if (!MatchesBool(params->query_info.highlighted.get(), |
896 tab_strip->IsTabSelected(i))) { | 897 tab_strip->IsTabSelected(i))) { |
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2098 params->tab_id | 2099 params->tab_id |
2099 ? ErrorUtils::FormatErrorMessage(keys::kCannotDiscardTab, | 2100 ? ErrorUtils::FormatErrorMessage(keys::kCannotDiscardTab, |
2100 base::IntToString(*params->tab_id)) | 2101 base::IntToString(*params->tab_id)) |
2101 : keys::kCannotFindTabToDiscard)); | 2102 : keys::kCannotFindTabToDiscard)); |
2102 } | 2103 } |
2103 | 2104 |
2104 TabsDiscardFunction::TabsDiscardFunction() {} | 2105 TabsDiscardFunction::TabsDiscardFunction() {} |
2105 TabsDiscardFunction::~TabsDiscardFunction() {} | 2106 TabsDiscardFunction::~TabsDiscardFunction() {} |
2106 | 2107 |
2107 } // namespace extensions | 2108 } // namespace extensions |
OLD | NEW |