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

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

Issue 2960903002: VR: Use ToolbarModel to drive VR URL bar state. (Closed)
Patch Set: Created 3 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/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 b881c09ac3f5cf95b0f0739ee9caa83ead40420f..93b276c55c24e68271ba69142b83708f34a1ec95 100644
--- a/chrome/browser/android/vr_shell/vr_shell.cc
+++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -21,6 +21,7 @@
#include "base/values.h"
#include "chrome/browser/android/tab_android.h"
#include "chrome/browser/android/vr_shell/android_ui_gesture_target.h"
+#include "chrome/browser/android/vr_shell/toolbar_helper.h"
#include "chrome/browser/android/vr_shell/ui_interface.h"
#include "chrome/browser/android/vr_shell/ui_scene_manager.h"
#include "chrome/browser/android/vr_shell/vr_compositor.h"
@@ -116,6 +117,7 @@ VrShell::VrShell(JNIEnv* env,
for_web_vr, web_vr_autopresented, in_cct, reprojected_rendering_,
HasDaydreamSupport(env));
ui_ = gl_thread_.get();
+ toolbar_ = base::MakeUnique<ToolbarHelper>(ui_, this);
base::Thread::Options options(base::MessageLoop::TYPE_DEFAULT, 0);
options.priority = base::ThreadPriority::DISPLAY;
@@ -155,8 +157,8 @@ void VrShell::SwapContents(
return;
}
input_manager_ = base::MakeUnique<VrInputManager>(web_contents_);
- vr_web_contents_observer_ =
- base::MakeUnique<VrWebContentsObserver>(web_contents_, ui_, this);
+ vr_web_contents_observer_ = base::MakeUnique<VrWebContentsObserver>(
+ web_contents_, this, ui_, toolbar_.get());
// TODO(billorr): Make VrMetricsHelper tab-aware and able to track multiple
// tabs. crbug.com/684661
metrics_helper_ = base::MakeUnique<VrMetricsHelper>(web_contents_);
@@ -165,14 +167,13 @@ void VrShell::SwapContents(
}
void VrShell::SetUiState() {
+ toolbar_->Update();
+
if (!web_contents_) {
- // TODO(mthiesse): Properly handle native page URLs.
- ui_->SetURL(GURL());
ui_->SetLoading(false);
ui_->SetFullscreen(false);
ui_->SetIncognito(false);
} else {
- ui_->SetURL(web_contents_->GetVisibleURL());
ui_->SetLoading(web_contents_->IsLoading());
ui_->SetFullscreen(web_contents_->IsFullscreen());
ui_->SetIncognito(web_contents_->GetBrowserContext()->IsOffTheRecord());
@@ -699,6 +700,10 @@ bool VrShell::HasDaydreamSupport(JNIEnv* env) {
return Java_VrShellImpl_hasDaydreamSupport(env, j_vr_shell_.obj());
}
+content::WebContents* VrShell::GetActiveWebContents() const {
+ return web_contents_;
+}
+
// ----------------------------------------------------------------------------
// Native JNI methods
// ----------------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698