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

Side by Side Diff: chrome/browser/android/vr_shell/vr_shell.cc

Issue 2688413007: Add display::GetDisplayNearestView (Closed)
Patch Set: updated log #2 Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/android/vr_shell/vr_shell.h" 5 #include "chrome/browser/android/vr_shell/vr_shell.h"
6 6
7 #include <android/native_window_jni.h> 7 #include <android/native_window_jni.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 508
509 void VrShell::RenderViewHostChanged(content::RenderViewHost* old_host, 509 void VrShell::RenderViewHostChanged(content::RenderViewHost* old_host,
510 content::RenderViewHost* new_host) { 510 content::RenderViewHost* new_host) {
511 content::RenderWidgetHostView* view = new_host->GetWidget()->GetView(); 511 content::RenderWidgetHostView* view = new_host->GetWidget()->GetView();
512 view->SetBackgroundColor(SK_ColorTRANSPARENT); 512 view->SetBackgroundColor(SK_ColorTRANSPARENT);
513 view->SetIsInVR(true); 513 view->SetIsInVR(true);
514 } 514 }
515 515
516 void VrShell::MainFrameWasResized(bool width_changed) { 516 void VrShell::MainFrameWasResized(bool width_changed) {
517 display::Display display = 517 display::Display display =
518 display::Screen::GetScreen()->GetDisplayNearestWindow( 518 display::Screen::GetScreen()->GetDisplayNearestView(
519 ui_contents_->GetNativeView()); 519 ui_contents_->GetNativeView());
520 PostToGlThreadWhenReady( 520 PostToGlThreadWhenReady(
521 base::Bind(&VrShellGl::UIBoundsChanged, gl_thread_->GetVrShellGl(), 521 base::Bind(&VrShellGl::UIBoundsChanged, gl_thread_->GetVrShellGl(),
522 display.size().width(), display.size().height())); 522 display.size().width(), display.size().height()));
523 } 523 }
524 524
525 void VrShell::ContentFrameWasResized(bool width_changed) { 525 void VrShell::ContentFrameWasResized(bool width_changed) {
526 display::Display display = 526 display::Display display =
527 display::Screen::GetScreen()->GetDisplayNearestWindow(content_window_); 527 display::Screen::GetScreen()->GetDisplayNearestWindow(content_window_);
528 PostToGlThreadWhenReady( 528 PostToGlThreadWhenReady(
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 jboolean reprojected_rendering) { 695 jboolean reprojected_rendering) {
696 return reinterpret_cast<intptr_t>(new VrShell( 696 return reinterpret_cast<intptr_t>(new VrShell(
697 env, obj, reinterpret_cast<ui::WindowAndroid*>(content_window_android), 697 env, obj, reinterpret_cast<ui::WindowAndroid*>(content_window_android),
698 content::WebContents::FromJavaWebContents(ui_web_contents), 698 content::WebContents::FromJavaWebContents(ui_web_contents),
699 reinterpret_cast<ui::WindowAndroid*>(ui_window_android), for_web_vr, 699 reinterpret_cast<ui::WindowAndroid*>(ui_window_android), for_web_vr,
700 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), 700 VrShellDelegate::GetNativeVrShellDelegate(env, delegate),
701 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); 701 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering));
702 } 702 }
703 703
704 } // namespace vr_shell 704 } // namespace vr_shell
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/display/output_protection_delegate.cc » ('j') | extensions/shell/browser/shell_screen.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698