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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 #include "extensions/browser/extension_function_dispatcher.h" | 68 #include "extensions/browser/extension_function_dispatcher.h" |
69 #include "extensions/browser/extension_function_util.h" | 69 #include "extensions/browser/extension_function_util.h" |
70 #include "extensions/browser/extension_host.h" | 70 #include "extensions/browser/extension_host.h" |
71 #include "extensions/browser/extension_zoom_request_client.h" | 71 #include "extensions/browser/extension_zoom_request_client.h" |
72 #include "extensions/browser/file_reader.h" | 72 #include "extensions/browser/file_reader.h" |
73 #include "extensions/browser/script_executor.h" | 73 #include "extensions/browser/script_executor.h" |
74 #include "extensions/common/api/extension_types.h" | 74 #include "extensions/common/api/extension_types.h" |
75 #include "extensions/common/constants.h" | 75 #include "extensions/common/constants.h" |
76 #include "extensions/common/error_utils.h" | 76 #include "extensions/common/error_utils.h" |
77 #include "extensions/common/extension.h" | 77 #include "extensions/common/extension.h" |
| 78 #include "extensions/common/host_id.h" |
78 #include "extensions/common/manifest_constants.h" | 79 #include "extensions/common/manifest_constants.h" |
79 #include "extensions/common/manifest_handlers/default_locale_handler.h" | 80 #include "extensions/common/manifest_handlers/default_locale_handler.h" |
80 #include "extensions/common/message_bundle.h" | 81 #include "extensions/common/message_bundle.h" |
81 #include "extensions/common/permissions/permissions_data.h" | 82 #include "extensions/common/permissions/permissions_data.h" |
82 #include "extensions/common/user_script.h" | 83 #include "extensions/common/user_script.h" |
83 #include "skia/ext/image_operations.h" | 84 #include "skia/ext/image_operations.h" |
84 #include "skia/ext/platform_canvas.h" | 85 #include "skia/ext/platform_canvas.h" |
85 #include "third_party/skia/include/core/SkBitmap.h" | 86 #include "third_party/skia/include/core/SkBitmap.h" |
86 #include "ui/base/models/list_selection_model.h" | 87 #include "ui/base/models/list_selection_model.h" |
87 #include "ui/base/ui_base_types.h" | 88 #include "ui/base/ui_base_types.h" |
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 TabHelper::FromWebContents(web_contents_)->script_executor()->ExecuteScript( | 1244 TabHelper::FromWebContents(web_contents_)->script_executor()->ExecuteScript( |
1244 extension_id(), | 1245 extension_id(), |
1245 ScriptExecutor::JAVASCRIPT, | 1246 ScriptExecutor::JAVASCRIPT, |
1246 url.GetContent(), | 1247 url.GetContent(), |
1247 ScriptExecutor::TOP_FRAME, | 1248 ScriptExecutor::TOP_FRAME, |
1248 ScriptExecutor::DONT_MATCH_ABOUT_BLANK, | 1249 ScriptExecutor::DONT_MATCH_ABOUT_BLANK, |
1249 UserScript::DOCUMENT_IDLE, | 1250 UserScript::DOCUMENT_IDLE, |
1250 ScriptExecutor::MAIN_WORLD, | 1251 ScriptExecutor::MAIN_WORLD, |
1251 ScriptExecutor::DEFAULT_PROCESS, | 1252 ScriptExecutor::DEFAULT_PROCESS, |
1252 GURL(), | 1253 GURL(), |
| 1254 Host::kDefaultInstanceId, |
1253 GURL(), | 1255 GURL(), |
1254 user_gesture_, | 1256 user_gesture_, |
1255 ScriptExecutor::NO_RESULT, | 1257 ScriptExecutor::NO_RESULT, |
1256 base::Bind(&TabsUpdateFunction::OnExecuteCodeFinished, this)); | 1258 base::Bind(&TabsUpdateFunction::OnExecuteCodeFinished, this)); |
1257 | 1259 |
1258 *is_async = true; | 1260 *is_async = true; |
1259 return true; | 1261 return true; |
1260 } | 1262 } |
1261 | 1263 |
1262 web_contents_->GetController().LoadURL( | 1264 web_contents_->GetController().LoadURL( |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1790 } | 1792 } |
1791 | 1793 |
1792 bool ExecuteCodeInTabFunction::IsWebView() const { | 1794 bool ExecuteCodeInTabFunction::IsWebView() const { |
1793 return false; | 1795 return false; |
1794 } | 1796 } |
1795 | 1797 |
1796 const GURL& ExecuteCodeInTabFunction::GetWebViewSrc() const { | 1798 const GURL& ExecuteCodeInTabFunction::GetWebViewSrc() const { |
1797 return GURL::EmptyGURL(); | 1799 return GURL::EmptyGURL(); |
1798 } | 1800 } |
1799 | 1801 |
| 1802 int ExecuteCodeInTabFunction::GetScriptInjectionInstanceId() const { |
| 1803 return Host::kDefaultInstanceId; |
| 1804 } |
| 1805 |
1800 bool TabsExecuteScriptFunction::ShouldInsertCSS() const { | 1806 bool TabsExecuteScriptFunction::ShouldInsertCSS() const { |
1801 return false; | 1807 return false; |
1802 } | 1808 } |
1803 | 1809 |
1804 void TabsExecuteScriptFunction::OnExecuteCodeFinished( | 1810 void TabsExecuteScriptFunction::OnExecuteCodeFinished( |
1805 const std::string& error, | 1811 const std::string& error, |
1806 const GURL& on_url, | 1812 const GURL& on_url, |
1807 const base::ListValue& result) { | 1813 const base::ListValue& result) { |
1808 if (error.empty()) | 1814 if (error.empty()) |
1809 SetResult(result.DeepCopy()); | 1815 SetResult(result.DeepCopy()); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1951 ZoomController::ZoomMode zoom_mode = zoom_controller->zoom_mode(); | 1957 ZoomController::ZoomMode zoom_mode = zoom_controller->zoom_mode(); |
1952 api::tabs::ZoomSettings zoom_settings; | 1958 api::tabs::ZoomSettings zoom_settings; |
1953 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); | 1959 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); |
1954 | 1960 |
1955 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); | 1961 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); |
1956 SendResponse(true); | 1962 SendResponse(true); |
1957 return true; | 1963 return true; |
1958 } | 1964 } |
1959 | 1965 |
1960 } // namespace extensions | 1966 } // namespace extensions |
OLD | NEW |