| 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 "chrome/browser/extensions/api/web_view/web_view_internal_api.h" | 5 #include "chrome/browser/extensions/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 "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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 | 534 |
| 535 EXTENSION_FUNCTION_VALIDATE( | 535 EXTENSION_FUNCTION_VALIDATE( |
| 536 result != WebViewPermissionHelper::SET_PERMISSION_INVALID); | 536 result != WebViewPermissionHelper::SET_PERMISSION_INVALID); |
| 537 | 537 |
| 538 SetResult(new base::FundamentalValue( | 538 SetResult(new base::FundamentalValue( |
| 539 result == WebViewPermissionHelper::SET_PERMISSION_ALLOWED)); | 539 result == WebViewPermissionHelper::SET_PERMISSION_ALLOWED)); |
| 540 SendResponse(true); | 540 SendResponse(true); |
| 541 return true; | 541 return true; |
| 542 } | 542 } |
| 543 | 543 |
| 544 WebViewInternalSetAutoSizeFunction:: |
| 545 WebViewInternalSetAutoSizeFunction() { |
| 546 } |
| 547 |
| 548 WebViewInternalSetAutoSizeFunction:: |
| 549 ~WebViewInternalSetAutoSizeFunction() { |
| 550 } |
| 551 |
| 552 bool WebViewInternalSetAutoSizeFunction::RunAsyncSafe(WebViewGuest* guest) { |
| 553 scoped_ptr<webview::SetAutoSize::Params> params( |
| 554 webview::SetAutoSize::Params::Create(*args_)); |
| 555 EXTENSION_FUNCTION_VALIDATE(params.get()); |
| 556 guest->SetAutoSize(params->params.enable_auto_size, |
| 557 gfx::Size(params->params.min.width, |
| 558 params->params.min.height), |
| 559 gfx::Size(params->params.max.width, |
| 560 params->params.max.height)); |
| 561 SendResponse(true); |
| 562 return true; |
| 563 } |
| 564 |
| 544 WebViewInternalShowContextMenuFunction:: | 565 WebViewInternalShowContextMenuFunction:: |
| 545 WebViewInternalShowContextMenuFunction() { | 566 WebViewInternalShowContextMenuFunction() { |
| 546 } | 567 } |
| 547 | 568 |
| 548 WebViewInternalShowContextMenuFunction:: | 569 WebViewInternalShowContextMenuFunction:: |
| 549 ~WebViewInternalShowContextMenuFunction() { | 570 ~WebViewInternalShowContextMenuFunction() { |
| 550 } | 571 } |
| 551 | 572 |
| 552 bool WebViewInternalShowContextMenuFunction::RunAsyncSafe(WebViewGuest* guest) { | 573 bool WebViewInternalShowContextMenuFunction::RunAsyncSafe(WebViewGuest* guest) { |
| 553 scoped_ptr<webview::ShowContextMenu::Params> params( | 574 scoped_ptr<webview::ShowContextMenu::Params> params( |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 | 617 |
| 597 WebViewInternalTerminateFunction::~WebViewInternalTerminateFunction() { | 618 WebViewInternalTerminateFunction::~WebViewInternalTerminateFunction() { |
| 598 } | 619 } |
| 599 | 620 |
| 600 bool WebViewInternalTerminateFunction::RunAsyncSafe(WebViewGuest* guest) { | 621 bool WebViewInternalTerminateFunction::RunAsyncSafe(WebViewGuest* guest) { |
| 601 guest->Terminate(); | 622 guest->Terminate(); |
| 602 return true; | 623 return true; |
| 603 } | 624 } |
| 604 | 625 |
| 605 } // namespace extensions | 626 } // namespace extensions |
| OLD | NEW |