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

Unified Diff: chrome/browser/webview/webview_guest.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: 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
« no previous file with comments | « chrome/browser/webview/webview_guest.h ('k') | chrome/common/extensions/api/webview.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/webview/webview_guest.cc
diff --git a/chrome/browser/webview/webview_guest.cc b/chrome/browser/webview/webview_guest.cc
index c4f8f1fed3663d616268f73200e35cd5d7be9f95..f86c0810996298995cc77cc94879fad857386396 100644
--- a/chrome/browser/webview/webview_guest.cc
+++ b/chrome/browser/webview/webview_guest.cc
@@ -66,6 +66,10 @@ WebViewGuest* WebViewGuest::From(int embedder_process_id,
return it == guest_map->end() ? NULL : it->second;
}
+void WebViewGuest::Go(int relative_index) {
+ web_contents()->GetController().GoToOffset(relative_index);
+}
+
WebViewGuest::~WebViewGuest() {
std::pair<int, int> key(embedder_render_process_id_, guest_instance_id_);
webview_guest_map.Get().erase(key);
@@ -97,6 +101,10 @@ void WebViewGuest::DidCommitProvisionalLoadForFrame(
scoped_ptr<DictionaryValue> event(new DictionaryValue());
event->SetString(webview::kUrl, url.spec());
event->SetBoolean(webview::kIsTopLevel, is_main_frame);
+ event->SetInteger(webview::kInternalCurrentEntryIndex,
+ web_contents()->GetController().GetCurrentEntryIndex());
+ event->SetInteger(webview::kInternalEntryCount,
+ web_contents()->GetController().GetEntryCount());
DispatchEvent(webview::kEventLoadCommit, event.Pass());
}
« no previous file with comments | « chrome/browser/webview/webview_guest.h ('k') | chrome/common/extensions/api/webview.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698