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 <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 return false; | 983 return false; |
984 | 984 |
985 SetResult(ExtensionTabUtil::CreateTabValue( | 985 SetResult(ExtensionTabUtil::CreateTabValue( |
986 contents, tab_strip, tab_index, extension())); | 986 contents, tab_strip, tab_index, extension())); |
987 return true; | 987 return true; |
988 } | 988 } |
989 | 989 |
990 bool TabsGetCurrentFunction::RunSync() { | 990 bool TabsGetCurrentFunction::RunSync() { |
991 DCHECK(dispatcher()); | 991 DCHECK(dispatcher()); |
992 | 992 |
993 WebContents* contents = dispatcher()->delegate()->GetAssociatedWebContents(); | 993 WebContents* contents = dispatcher()->delegate()->GetVisibleWebContents(); |
994 if (contents) | 994 if (contents) |
995 SetResult(ExtensionTabUtil::CreateTabValue(contents, extension())); | 995 SetResult(ExtensionTabUtil::CreateTabValue(contents, extension())); |
996 | 996 |
997 return true; | 997 return true; |
998 } | 998 } |
999 | 999 |
1000 bool TabsHighlightFunction::RunSync() { | 1000 bool TabsHighlightFunction::RunSync() { |
1001 scoped_ptr<tabs::Highlight::Params> params( | 1001 scoped_ptr<tabs::Highlight::Params> params( |
1002 tabs::Highlight::Params::Create(*args_)); | 1002 tabs::Highlight::Params::Create(*args_)); |
1003 EXTENSION_FUNCTION_VALIDATE(params.get()); | 1003 EXTENSION_FUNCTION_VALIDATE(params.get()); |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1892 ZoomController::ZoomMode zoom_mode = zoom_controller->zoom_mode(); | 1892 ZoomController::ZoomMode zoom_mode = zoom_controller->zoom_mode(); |
1893 api::tabs::ZoomSettings zoom_settings; | 1893 api::tabs::ZoomSettings zoom_settings; |
1894 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); | 1894 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); |
1895 | 1895 |
1896 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); | 1896 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); |
1897 SendResponse(true); | 1897 SendResponse(true); |
1898 return true; | 1898 return true; |
1899 } | 1899 } |
1900 | 1900 |
1901 } // namespace extensions | 1901 } // namespace extensions |
OLD | NEW |