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 <utility> | 10 #include <utility> |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "chrome/browser/extensions/window_controller.h" | 35 #include "chrome/browser/extensions/window_controller.h" |
36 #include "chrome/browser/extensions/window_controller_list.h" | 36 #include "chrome/browser/extensions/window_controller_list.h" |
37 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 37 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
38 #include "chrome/browser/profiles/profile.h" | 38 #include "chrome/browser/profiles/profile.h" |
39 #include "chrome/browser/sessions/session_tab_helper.h" | 39 #include "chrome/browser/sessions/session_tab_helper.h" |
40 #include "chrome/browser/translate/chrome_translate_client.h" | 40 #include "chrome/browser/translate/chrome_translate_client.h" |
41 #include "chrome/browser/ui/apps/chrome_app_delegate.h" | 41 #include "chrome/browser/ui/apps/chrome_app_delegate.h" |
42 #include "chrome/browser/ui/browser.h" | 42 #include "chrome/browser/ui/browser.h" |
43 #include "chrome/browser/ui/browser_commands.h" | 43 #include "chrome/browser/ui/browser_commands.h" |
44 #include "chrome/browser/ui/browser_finder.h" | 44 #include "chrome/browser/ui/browser_finder.h" |
45 #include "chrome/browser/ui/browser_iterator.h" | 45 #include "chrome/browser/ui/browser_list.h" |
46 #include "chrome/browser/ui/browser_navigator.h" | 46 #include "chrome/browser/ui/browser_navigator.h" |
47 #include "chrome/browser/ui/browser_tabstrip.h" | 47 #include "chrome/browser/ui/browser_tabstrip.h" |
48 #include "chrome/browser/ui/browser_window.h" | 48 #include "chrome/browser/ui/browser_window.h" |
49 #include "chrome/browser/ui/host_desktop.h" | 49 #include "chrome/browser/ui/host_desktop.h" |
50 #include "chrome/browser/ui/panels/panel_manager.h" | 50 #include "chrome/browser/ui/panels/panel_manager.h" |
51 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 51 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
52 #include "chrome/browser/ui/tabs/tab_utils.h" | 52 #include "chrome/browser/ui/tabs/tab_utils.h" |
53 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 53 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
54 #include "chrome/browser/web_applications/web_app.h" | 54 #include "chrome/browser/web_applications/web_app.h" |
55 #include "chrome/common/chrome_switches.h" | 55 #include "chrome/common/chrome_switches.h" |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 index = *params->query_info.index; | 908 index = *params->query_info.index; |
909 | 909 |
910 std::string window_type; | 910 std::string window_type; |
911 if (params->query_info.window_type != tabs::WINDOW_TYPE_NONE) | 911 if (params->query_info.window_type != tabs::WINDOW_TYPE_NONE) |
912 window_type = tabs::ToString(params->query_info.window_type); | 912 window_type = tabs::ToString(params->query_info.window_type); |
913 | 913 |
914 base::ListValue* result = new base::ListValue(); | 914 base::ListValue* result = new base::ListValue(); |
915 Browser* last_active_browser = chrome::FindAnyBrowser( | 915 Browser* last_active_browser = chrome::FindAnyBrowser( |
916 GetProfile(), include_incognito(), chrome::GetActiveDesktop()); | 916 GetProfile(), include_incognito(), chrome::GetActiveDesktop()); |
917 Browser* current_browser = GetCurrentBrowser(); | 917 Browser* current_browser = GetCurrentBrowser(); |
918 for (chrome::BrowserIterator it; !it.done(); it.Next()) { | 918 for (auto* browser : *BrowserList::GetInstance()) { |
919 Browser* browser = *it; | |
920 if (!GetProfile()->IsSameProfile(browser->profile())) | 919 if (!GetProfile()->IsSameProfile(browser->profile())) |
921 continue; | 920 continue; |
922 | 921 |
923 if (!browser->window()) | 922 if (!browser->window()) |
924 continue; | 923 continue; |
925 | 924 |
926 if (!include_incognito() && GetProfile() != browser->profile()) | 925 if (!include_incognito() && GetProfile() != browser->profile()) |
927 continue; | 926 continue; |
928 | 927 |
929 if (!browser->extension_window_controller()->IsVisibleToExtension( | 928 if (!browser->extension_window_controller()->IsVisibleToExtension( |
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2060 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); | 2059 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); |
2061 zoom_settings.default_zoom_factor.reset(new double( | 2060 zoom_settings.default_zoom_factor.reset(new double( |
2062 content::ZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel()))); | 2061 content::ZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel()))); |
2063 | 2062 |
2064 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); | 2063 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); |
2065 SendResponse(true); | 2064 SendResponse(true); |
2066 return true; | 2065 return true; |
2067 } | 2066 } |
2068 | 2067 |
2069 } // namespace extensions | 2068 } // namespace extensions |
OLD | NEW |