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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 24101003: Make the RenderViewHostImpl update its visibility after a swap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change DCHECKs to early-outs on NULL Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 window_->SetDefaultParentByRootWindow(parent, bounds); 683 window_->SetDefaultParentByRootWindow(parent, bounds);
684 Show(); 684 Show();
685 Focus(); 685 Focus();
686 } 686 }
687 687
688 RenderWidgetHost* RenderWidgetHostViewAura::GetRenderWidgetHost() const { 688 RenderWidgetHost* RenderWidgetHostViewAura::GetRenderWidgetHost() const {
689 return host_; 689 return host_;
690 } 690 }
691 691
692 void RenderWidgetHostViewAura::WasShown() { 692 void RenderWidgetHostViewAura::WasShown() {
693 if (!host_->is_hidden()) 693 if (!host_ || !host_->is_hidden())
694 return; 694 return;
695 host_->WasShown(); 695 host_->WasShown();
696 if (framebuffer_holder_) 696 if (framebuffer_holder_)
697 FrameMemoryManager::GetInstance()->SetFrameVisibility(this, true); 697 FrameMemoryManager::GetInstance()->SetFrameVisibility(this, true);
698 698
699 aura::client::CursorClient* cursor_client = 699 aura::client::CursorClient* cursor_client =
700 aura::client::GetCursorClient(window_->GetRootWindow()); 700 aura::client::GetCursorClient(window_->GetRootWindow());
701 if (cursor_client) 701 if (cursor_client)
702 NotifyRendererOfCursorVisibilityState(cursor_client->IsCursorVisible()); 702 NotifyRendererOfCursorVisibilityState(cursor_client->IsCursorVisible());
703 703
704 if (!current_surface_.get() && host_->is_accelerated_compositing_active() && 704 if (!current_surface_.get() && host_->is_accelerated_compositing_active() &&
705 !released_front_lock_.get()) { 705 !released_front_lock_.get()) {
706 released_front_lock_ = GetCompositor()->GetCompositorLock(); 706 released_front_lock_ = GetCompositor()->GetCompositorLock();
707 } 707 }
708 708
709 #if defined(OS_WIN) 709 #if defined(OS_WIN)
710 LPARAM lparam = reinterpret_cast<LPARAM>(this); 710 LPARAM lparam = reinterpret_cast<LPARAM>(this);
711 EnumChildWindows(ui::GetHiddenWindow(), ShowWindowsCallback, lparam); 711 EnumChildWindows(ui::GetHiddenWindow(), ShowWindowsCallback, lparam);
712 transient_observer_->SendPluginCutoutRects(); 712 transient_observer_->SendPluginCutoutRects();
713 #endif 713 #endif
714 } 714 }
715 715
716 void RenderWidgetHostViewAura::WasHidden() { 716 void RenderWidgetHostViewAura::WasHidden() {
717 if (host_->is_hidden()) 717 if (!host_ || host_->is_hidden())
718 return; 718 return;
719 host_->WasHidden(); 719 host_->WasHidden();
720 if (framebuffer_holder_) 720 if (framebuffer_holder_)
721 FrameMemoryManager::GetInstance()->SetFrameVisibility(this, false); 721 FrameMemoryManager::GetInstance()->SetFrameVisibility(this, false);
722 722
723 released_front_lock_ = NULL; 723 released_front_lock_ = NULL;
724 724
725 #if defined(OS_WIN) 725 #if defined(OS_WIN)
726 aura::RootWindow* root_window = window_->GetRootWindow(); 726 aura::RootWindow* root_window = window_->GetRootWindow();
727 if (root_window) { 727 if (root_window) {
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 bool RenderWidgetHostViewAura::HasFocus() const { 954 bool RenderWidgetHostViewAura::HasFocus() const {
955 return window_->HasFocus(); 955 return window_->HasFocus();
956 } 956 }
957 957
958 bool RenderWidgetHostViewAura::IsSurfaceAvailableForCopy() const { 958 bool RenderWidgetHostViewAura::IsSurfaceAvailableForCopy() const {
959 return CanCopyToBitmap() || !!host_->GetBackingStore(false); 959 return CanCopyToBitmap() || !!host_->GetBackingStore(false);
960 } 960 }
961 961
962 void RenderWidgetHostViewAura::Show() { 962 void RenderWidgetHostViewAura::Show() {
963 window_->Show(); 963 window_->Show();
964 WasShown();
no sievers 2013/09/19 19:49:08 I thought this somehow happened already when I fol
zturner 2013/09/19 20:46:45 The delegate is a RWHVA. So it goes into RWHVA::O
964 } 965 }
965 966
966 void RenderWidgetHostViewAura::Hide() { 967 void RenderWidgetHostViewAura::Hide() {
967 window_->Hide(); 968 window_->Hide();
969 WasHidden();
968 } 970 }
969 971
970 bool RenderWidgetHostViewAura::IsShowing() { 972 bool RenderWidgetHostViewAura::IsShowing() {
971 return window_->IsVisible(); 973 return window_->IsVisible();
972 } 974 }
973 975
974 gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const { 976 gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const {
975 // This is the size that we want the renderer to produce. While we're waiting 977 // This is the size that we want the renderer to produce. While we're waiting
976 // for the correct frame (i.e. during a resize), don't change the size so that 978 // for the correct frame (i.e. during a resize), don't change the size so that
977 // we don't pipeline more resizes than we can handle. 979 // we don't pipeline more resizes than we can handle.
(...skipping 2396 matching lines...) Expand 10 before | Expand all | Expand 10 after
3374 RenderWidgetHost* widget) { 3376 RenderWidgetHost* widget) {
3375 return new RenderWidgetHostViewAura(widget); 3377 return new RenderWidgetHostViewAura(widget);
3376 } 3378 }
3377 3379
3378 // static 3380 // static
3379 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 3381 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
3380 GetScreenInfoForWindow(results, NULL); 3382 GetScreenInfoForWindow(results, NULL);
3381 } 3383 }
3382 3384
3383 } // namespace content 3385 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698