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 printf("++++ %s, guest = [%p]\n", __PRETTY_FUNCTION__, guest); |
| 94 scoped_ptr<webview::Navigate::Params> params( |
| 95 webview::Navigate::Params::Create(*args_)); |
| 96 EXTENSION_FUNCTION_VALIDATE(params.get()); |
| 97 std::string src = params->src; |
| 98 printf("src was: %s\n", src.c_str()); |
| 99 guest->NavigateGuest(src); |
| 100 return true; |
| 101 } |
| 102 |
92 bool WebviewContextMenusUpdateFunction::RunAsync() { | 103 bool WebviewContextMenusUpdateFunction::RunAsync() { |
93 scoped_ptr<webview::ContextMenusUpdate::Params> params( | 104 scoped_ptr<webview::ContextMenusUpdate::Params> params( |
94 webview::ContextMenusUpdate::Params::Create(*args_)); | 105 webview::ContextMenusUpdate::Params::Create(*args_)); |
95 EXTENSION_FUNCTION_VALIDATE(params.get()); | 106 EXTENSION_FUNCTION_VALIDATE(params.get()); |
96 | 107 |
97 Profile* profile = Profile::FromBrowserContext(browser_context()); | 108 Profile* profile = Profile::FromBrowserContext(browser_context()); |
98 MenuItem::Id item_id( | 109 MenuItem::Id item_id( |
99 profile->IsOffTheRecord(), | 110 profile->IsOffTheRecord(), |
100 MenuItem::ExtensionKey(extension_id(), params->instance_id)); | 111 MenuItem::ExtensionKey(extension_id(), params->instance_id)); |
101 | 112 |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 | 584 |
574 WebviewTerminateFunction::~WebviewTerminateFunction() { | 585 WebviewTerminateFunction::~WebviewTerminateFunction() { |
575 } | 586 } |
576 | 587 |
577 bool WebviewTerminateFunction::RunAsyncSafe(WebViewGuest* guest) { | 588 bool WebviewTerminateFunction::RunAsyncSafe(WebViewGuest* guest) { |
578 guest->Terminate(); | 589 guest->Terminate(); |
579 return true; | 590 return true; |
580 } | 591 } |
581 | 592 |
582 } // namespace extensions | 593 } // namespace extensions |
OLD | NEW |