Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1289)

Unified Diff: chrome/browser/extensions/api/webview/webview_api.cc

Issue 17447005: <webview>: Move back, forward, canGoBack, canGoForward, go from content to chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@filter_listener
Patch Set: Merge against latest changes in other CL Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/webview/webview_api.cc
diff --git a/chrome/browser/extensions/api/webview/webview_api.cc b/chrome/browser/extensions/api/webview/webview_api.cc
index a5be9dfe60b17d3372c1edab6f2c38619d940695..ed9c5d000275d2ab5c2f32cab6c7db95abe91ea0 100644
--- a/chrome/browser/extensions/api/webview/webview_api.cc
+++ b/chrome/browser/extensions/api/webview/webview_api.cc
@@ -80,3 +80,24 @@ bool WebviewInsertCSSFunction::ShouldInsertCSS() const {
return true;
}
+WebviewGoFunction::WebviewGoFunction() {
+}
+
+WebviewGoFunction::~WebviewGoFunction() {
+}
+
+bool WebviewGoFunction::RunImpl() {
+ int instance_id;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &instance_id));
+
+ int relative_index;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(1, &relative_index));
+
+ chrome::WebViewGuest* guest = chrome::WebViewGuest::From(
+ render_view_host()->GetProcess()->GetID(), instance_id);
+ if (!guest)
+ return false;
+
+ guest->Go(relative_index);
+ return true;
+}

Powered by Google App Engine
This is Rietveld 408576698