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

Unified Diff: chrome/browser/android/vr_shell/vr_shell.cc

Issue 2647053002: Add initial VR interactive omnibox. (Closed)
Patch Set: Rebase to ToT. Created 3 years, 11 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/android/vr_shell/vr_shell.h ('k') | chrome/browser/resources/vr_shell/vr_shell_ui.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_shell.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc
index 8a0c52a371f1e3236275357f264c2d8266d805d0..d02f7271b0528b440aa4ca52fff0a6591e03042a 100644
--- a/chrome/browser/android/vr_shell/vr_shell.cc
+++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -6,6 +6,9 @@
#include <android/native_window_jni.h>
+#include <string>
+#include <utility>
+
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/threading/platform_thread.h"
@@ -329,7 +332,8 @@ void VrShell::UpdateScene(const base::ListValue* args) {
base::Passed(args->CreateDeepCopy())));
}
-void VrShell::DoUiAction(const UiAction action) {
+void VrShell::DoUiAction(const UiAction action,
+ const base::DictionaryValue* arguments) {
content::NavigationController& controller = main_contents_->GetController();
switch (action) {
case HISTORY_BACK:
@@ -346,6 +350,20 @@ void VrShell::DoUiAction(const UiAction action) {
case RELOAD:
controller.Reload(content::ReloadType::NORMAL, false);
break;
+ case LOAD_URL: {
+ std::string url_string;
+ CHECK(arguments->GetString("url", &url_string));
+ GURL url(url_string);
+ // TODO(crbug.com/683344): Sanitize the URL and prefix, and pass the
+ // proper transition type down from the UI.
+ controller.LoadURL(url, content::Referrer(),
+ ui::PageTransition::PAGE_TRANSITION_AUTO_TOPLEVEL,
+ std::string(""));
+ break;
+ }
+ case OMNIBOX_CONTENT:
+ html_interface_->HandleOmniboxInput(*arguments);
+ break;
#if defined(ENABLE_VR_SHELL_UI_DEV)
case RELOAD_UI:
ui_contents_->GetController().Reload(content::ReloadType::NORMAL, false);
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.h ('k') | chrome/browser/resources/vr_shell/vr_shell_ui.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698