OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/webview/webview_api.h" | 5 #include "chrome/browser/extensions/api/webview/webview_api.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/api/browsing_data/browsing_data_api.h" | 8 #include "chrome/browser/extensions/api/browsing_data/browsing_data_api.h" |
9 #include "chrome/browser/extensions/api/context_menus/context_menus_api.h" | 9 #include "chrome/browser/extensions/api/context_menus/context_menus_api.h" |
10 #include "chrome/browser/extensions/api/context_menus/context_menus_api_helpers.
h" | 10 #include "chrome/browser/extensions/api/context_menus/context_menus_api_helpers.
h" |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 WebViewGuest* guest = WebViewGuest::From( | 342 WebViewGuest* guest = WebViewGuest::From( |
343 render_view_host()->GetProcess()->GetID(), instance_id); | 343 render_view_host()->GetProcess()->GetID(), instance_id); |
344 return guest ? guest->guest_web_contents() : NULL; | 344 return guest ? guest->guest_web_contents() : NULL; |
345 } | 345 } |
346 | 346 |
347 void WebviewCaptureVisibleRegionFunction::OnCaptureFailure( | 347 void WebviewCaptureVisibleRegionFunction::OnCaptureFailure( |
348 FailureReason reason) { | 348 FailureReason reason) { |
349 SendResponse(false); | 349 SendResponse(false); |
350 } | 350 } |
351 | 351 |
| 352 WebviewSetNameFunction::WebviewSetNameFunction() { |
| 353 } |
| 354 |
| 355 WebviewSetNameFunction::~WebviewSetNameFunction() { |
| 356 } |
| 357 |
352 WebviewSetZoomFunction::WebviewSetZoomFunction() { | 358 WebviewSetZoomFunction::WebviewSetZoomFunction() { |
353 } | 359 } |
354 | 360 |
355 WebviewSetZoomFunction::~WebviewSetZoomFunction() { | 361 WebviewSetZoomFunction::~WebviewSetZoomFunction() { |
356 } | 362 } |
357 | 363 |
| 364 bool WebviewSetNameFunction::RunAsyncSafe(WebViewGuest* guest) { |
| 365 scoped_ptr<webview::SetName::Params> params( |
| 366 webview::SetName::Params::Create(*args_)); |
| 367 EXTENSION_FUNCTION_VALIDATE(params.get()); |
| 368 guest->SetName(params->frame_name); |
| 369 SendResponse(true); |
| 370 return true; |
| 371 } |
| 372 |
358 bool WebviewSetZoomFunction::RunAsyncSafe(WebViewGuest* guest) { | 373 bool WebviewSetZoomFunction::RunAsyncSafe(WebViewGuest* guest) { |
359 scoped_ptr<webview::SetZoom::Params> params( | 374 scoped_ptr<webview::SetZoom::Params> params( |
360 webview::SetZoom::Params::Create(*args_)); | 375 webview::SetZoom::Params::Create(*args_)); |
361 EXTENSION_FUNCTION_VALIDATE(params.get()); | 376 EXTENSION_FUNCTION_VALIDATE(params.get()); |
362 guest->SetZoom(params->zoom_factor); | 377 guest->SetZoom(params->zoom_factor); |
363 | 378 |
364 SendResponse(true); | 379 SendResponse(true); |
365 return true; | 380 return true; |
366 } | 381 } |
367 | 382 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 | 573 |
559 WebviewTerminateFunction::~WebviewTerminateFunction() { | 574 WebviewTerminateFunction::~WebviewTerminateFunction() { |
560 } | 575 } |
561 | 576 |
562 bool WebviewTerminateFunction::RunAsyncSafe(WebViewGuest* guest) { | 577 bool WebviewTerminateFunction::RunAsyncSafe(WebViewGuest* guest) { |
563 guest->Terminate(); | 578 guest->Terminate(); |
564 return true; | 579 return true; |
565 } | 580 } |
566 | 581 |
567 } // namespace extensions | 582 } // namespace extensions |
OLD | NEW |