| 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 bool WindowsGetLastFocusedFunction::RunSync() { | 329 bool WindowsGetLastFocusedFunction::RunSync() { |
| 330 std::unique_ptr<windows::GetLastFocused::Params> params( | 330 std::unique_ptr<windows::GetLastFocused::Params> params( |
| 331 windows::GetLastFocused::Params::Create(*args_)); | 331 windows::GetLastFocused::Params::Create(*args_)); |
| 332 EXTENSION_FUNCTION_VALIDATE(params.get()); | 332 EXTENSION_FUNCTION_VALIDATE(params.get()); |
| 333 | 333 |
| 334 ApiParameterExtractor<windows::GetLastFocused::Params> extractor( | 334 ApiParameterExtractor<windows::GetLastFocused::Params> extractor( |
| 335 params.get()); | 335 params.get()); |
| 336 // The WindowControllerList should contain a list of application, | 336 // The WindowControllerList should contain a list of application, |
| 337 // browser and devtools windows. | 337 // browser and devtools windows. |
| 338 WindowController* controller = nullptr; | 338 WindowController* controller = nullptr; |
| 339 for (auto iter : WindowControllerList::GetInstance()->windows()) { | 339 for (auto* iter : WindowControllerList::GetInstance()->windows()) { |
| 340 if (windows_util::CanOperateOnWindow(this, iter, | 340 if (windows_util::CanOperateOnWindow(this, iter, |
| 341 extractor.type_filters())) { | 341 extractor.type_filters())) { |
| 342 controller = iter; | 342 controller = iter; |
| 343 if (controller->window()->IsActive()) | 343 if (controller->window()->IsActive()) |
| 344 break; // Use focused window. | 344 break; // Use focused window. |
| 345 } | 345 } |
| 346 } | 346 } |
| 347 if (!controller) { | 347 if (!controller) { |
| 348 error_ = keys::kNoLastFocusedWindowError; | 348 error_ = keys::kNoLastFocusedWindowError; |
| 349 return false; | 349 return false; |
| (...skipping 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2162 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); | 2162 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); |
| 2163 zoom_settings.default_zoom_factor.reset(new double( | 2163 zoom_settings.default_zoom_factor.reset(new double( |
| 2164 content::ZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel()))); | 2164 content::ZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel()))); |
| 2165 | 2165 |
| 2166 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); | 2166 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); |
| 2167 SendResponse(true); | 2167 SendResponse(true); |
| 2168 return true; | 2168 return true; |
| 2169 } | 2169 } |
| 2170 | 2170 |
| 2171 } // namespace extensions | 2171 } // namespace extensions |
| OLD | NEW |