OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/web_view/web_view_internal_api.h" | 5 #include "extensions/browser/api/web_view/web_view_internal_api.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "content/public/browser/render_process_host.h" | 8 #include "content/public/browser/render_process_host.h" |
9 #include "content/public/browser/render_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
10 #include "content/public/browser/storage_partition.h" | 10 #include "content/public/browser/storage_partition.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 FailureReason reason) { | 173 FailureReason reason) { |
174 SendResponse(false); | 174 SendResponse(false); |
175 } | 175 } |
176 | 176 |
177 WebViewInternalSetNameFunction::WebViewInternalSetNameFunction() { | 177 WebViewInternalSetNameFunction::WebViewInternalSetNameFunction() { |
178 } | 178 } |
179 | 179 |
180 WebViewInternalSetNameFunction::~WebViewInternalSetNameFunction() { | 180 WebViewInternalSetNameFunction::~WebViewInternalSetNameFunction() { |
181 } | 181 } |
182 | 182 |
183 WebViewInternalSetZoomFunction::WebViewInternalSetZoomFunction() { | |
184 } | |
185 | |
186 WebViewInternalSetZoomFunction::~WebViewInternalSetZoomFunction() { | |
187 } | |
188 | |
189 bool WebViewInternalSetNameFunction::RunAsyncSafe(WebViewGuest* guest) { | 183 bool WebViewInternalSetNameFunction::RunAsyncSafe(WebViewGuest* guest) { |
190 scoped_ptr<webview::SetName::Params> params( | 184 scoped_ptr<webview::SetName::Params> params( |
191 webview::SetName::Params::Create(*args_)); | 185 webview::SetName::Params::Create(*args_)); |
192 EXTENSION_FUNCTION_VALIDATE(params.get()); | 186 EXTENSION_FUNCTION_VALIDATE(params.get()); |
193 guest->SetName(params->frame_name); | 187 guest->SetName(params->frame_name); |
194 SendResponse(true); | 188 SendResponse(true); |
195 return true; | 189 return true; |
196 } | 190 } |
197 | 191 |
| 192 WebViewInternalSetAllowTransparencyFunction:: |
| 193 WebViewInternalSetAllowTransparencyFunction() { |
| 194 } |
| 195 |
| 196 WebViewInternalSetAllowTransparencyFunction:: |
| 197 ~WebViewInternalSetAllowTransparencyFunction() { |
| 198 } |
| 199 |
| 200 bool WebViewInternalSetAllowTransparencyFunction::RunAsyncSafe( |
| 201 WebViewGuest* guest) { |
| 202 scoped_ptr<webview::SetAllowTransparency::Params> params( |
| 203 webview::SetAllowTransparency::Params::Create(*args_)); |
| 204 EXTENSION_FUNCTION_VALIDATE(params.get()); |
| 205 guest->SetAllowTransparency(params->allow); |
| 206 SendResponse(true); |
| 207 return true; |
| 208 } |
| 209 |
| 210 WebViewInternalSetZoomFunction::WebViewInternalSetZoomFunction() { |
| 211 } |
| 212 |
| 213 WebViewInternalSetZoomFunction::~WebViewInternalSetZoomFunction() { |
| 214 } |
| 215 |
198 bool WebViewInternalSetZoomFunction::RunAsyncSafe(WebViewGuest* guest) { | 216 bool WebViewInternalSetZoomFunction::RunAsyncSafe(WebViewGuest* guest) { |
199 scoped_ptr<webview::SetZoom::Params> params( | 217 scoped_ptr<webview::SetZoom::Params> params( |
200 webview::SetZoom::Params::Create(*args_)); | 218 webview::SetZoom::Params::Create(*args_)); |
201 EXTENSION_FUNCTION_VALIDATE(params.get()); | 219 EXTENSION_FUNCTION_VALIDATE(params.get()); |
202 guest->SetZoom(params->zoom_factor); | 220 guest->SetZoom(params->zoom_factor); |
203 | 221 |
204 SendResponse(true); | 222 SendResponse(true); |
205 return true; | 223 return true; |
206 } | 224 } |
207 | 225 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 // Will finish asynchronously. | 487 // Will finish asynchronously. |
470 return true; | 488 return true; |
471 } | 489 } |
472 | 490 |
473 void WebViewInternalClearDataFunction::ClearDataDone() { | 491 void WebViewInternalClearDataFunction::ClearDataDone() { |
474 Release(); // Balanced in RunAsync(). | 492 Release(); // Balanced in RunAsync(). |
475 SendResponse(true); | 493 SendResponse(true); |
476 } | 494 } |
477 | 495 |
478 } // namespace extensions | 496 } // namespace extensions |
OLD | NEW |