| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 params->create_properties, | 82 params->create_properties, |
| 83 Profile::FromBrowserContext(browser_context()), | 83 Profile::FromBrowserContext(browser_context()), |
| 84 GetExtension(), | 84 GetExtension(), |
| 85 id, | 85 id, |
| 86 &error_); | 86 &error_); |
| 87 | 87 |
| 88 SendResponse(success); | 88 SendResponse(success); |
| 89 return success; | 89 return success; |
| 90 } | 90 } |
| 91 | 91 |
| 92 bool WebviewNavigateFunction::RunAsyncSafe(WebViewGuest* guest) { |
| 93 scoped_ptr<webview::Navigate::Params> params( |
| 94 webview::Navigate::Params::Create(*args_)); |
| 95 EXTENSION_FUNCTION_VALIDATE(params.get()); |
| 96 std::string src = params->src; |
| 97 guest->NavigateGuest(src); |
| 98 return true; |
| 99 } |
| 100 |
| 92 bool WebviewContextMenusUpdateFunction::RunAsync() { | 101 bool WebviewContextMenusUpdateFunction::RunAsync() { |
| 93 scoped_ptr<webview::ContextMenusUpdate::Params> params( | 102 scoped_ptr<webview::ContextMenusUpdate::Params> params( |
| 94 webview::ContextMenusUpdate::Params::Create(*args_)); | 103 webview::ContextMenusUpdate::Params::Create(*args_)); |
| 95 EXTENSION_FUNCTION_VALIDATE(params.get()); | 104 EXTENSION_FUNCTION_VALIDATE(params.get()); |
| 96 | 105 |
| 97 Profile* profile = Profile::FromBrowserContext(browser_context()); | 106 Profile* profile = Profile::FromBrowserContext(browser_context()); |
| 98 MenuItem::Id item_id( | 107 MenuItem::Id item_id( |
| 99 profile->IsOffTheRecord(), | 108 profile->IsOffTheRecord(), |
| 100 MenuItem::ExtensionKey(extension_id(), params->instance_id)); | 109 MenuItem::ExtensionKey(extension_id(), params->instance_id)); |
| 101 | 110 |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 | 582 |
| 574 WebviewTerminateFunction::~WebviewTerminateFunction() { | 583 WebviewTerminateFunction::~WebviewTerminateFunction() { |
| 575 } | 584 } |
| 576 | 585 |
| 577 bool WebviewTerminateFunction::RunAsyncSafe(WebViewGuest* guest) { | 586 bool WebviewTerminateFunction::RunAsyncSafe(WebViewGuest* guest) { |
| 578 guest->Terminate(); | 587 guest->Terminate(); |
| 579 return true; | 588 return true; |
| 580 } | 589 } |
| 581 | 590 |
| 582 } // namespace extensions | 591 } // namespace extensions |
| OLD | NEW |