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

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

Issue 10753017: In Windows 8 chrome metro mode if we Alt tabbed away from chrome while a tab was loading, we would … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_win.h" 5 #include "content/browser/renderer_host/render_widget_host_view_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <peninputpanel_i.c> 9 #include <peninputpanel_i.c>
10 10
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 bool RenderWidgetHostViewWin::HasFocus() const { 932 bool RenderWidgetHostViewWin::HasFocus() const {
933 return ::GetFocus() == m_hWnd; 933 return ::GetFocus() == m_hWnd;
934 } 934 }
935 935
936 bool RenderWidgetHostViewWin::IsSurfaceAvailableForCopy() const { 936 bool RenderWidgetHostViewWin::IsSurfaceAvailableForCopy() const {
937 return !!render_widget_host_->GetBackingStore(false) || 937 return !!render_widget_host_->GetBackingStore(false) ||
938 !!accelerated_surface_.get(); 938 !!accelerated_surface_.get();
939 } 939 }
940 940
941 void RenderWidgetHostViewWin::Show() { 941 void RenderWidgetHostViewWin::Show() {
942 if (!is_fullscreen_) {
943 DCHECK(parent_hwnd_);
944 DCHECK(parent_hwnd_ != ui::GetWindowToParentTo(true));
945 SetParent(parent_hwnd_);
946 }
947 ShowWindow(SW_SHOW); 942 ShowWindow(SW_SHOW);
948
949 WasRestored(); 943 WasRestored();
950 } 944 }
951 945
952 void RenderWidgetHostViewWin::Hide() { 946 void RenderWidgetHostViewWin::Hide() {
953 if (!is_fullscreen_ && GetParent() == ui::GetWindowToParentTo(true)) { 947 if (!is_fullscreen_ && GetParent() == ui::GetWindowToParentTo(true)) {
954 LOG(WARNING) << "Hide() called twice in a row: " << this << ":" << 948 LOG(WARNING) << "Hide() called twice in a row: " << this << ":" <<
955 parent_hwnd_ << ":" << GetParent(); 949 parent_hwnd_ << ":" << GetParent();
956 return; 950 return;
957 } 951 }
958 952
959 if (::GetFocus() == m_hWnd) 953 if (::GetFocus() == m_hWnd)
960 ::SetFocus(NULL); 954 ::SetFocus(NULL);
961 ShowWindow(SW_HIDE); 955 ShowWindow(SW_HIDE);
962 956
963 if (!is_fullscreen_) {
964 // Cache the old parent, then orphan the window so we stop receiving
965 // messages.
966 parent_hwnd_ = GetParent();
967 SetParent(NULL);
968 }
cpu_(ooo_6.6-7.5) 2012/07/10 02:45:18 do we need the parent_hwnd_ anymore?
969
970 WasHidden(); 957 WasHidden();
971 } 958 }
972 959
973 bool RenderWidgetHostViewWin::IsShowing() { 960 bool RenderWidgetHostViewWin::IsShowing() {
974 return !!IsWindowVisible(); 961 return !!IsWindowVisible();
975 } 962 }
976 963
977 gfx::Rect RenderWidgetHostViewWin::GetViewBounds() const { 964 gfx::Rect RenderWidgetHostViewWin::GetViewBounds() const {
978 CRect window_rect; 965 CRect window_rect;
979 GetWindowRect(&window_rect); 966 GetWindowRect(&window_rect);
(...skipping 2185 matching lines...) Expand 10 before | Expand all | Expand 10 after
3165 void RenderWidgetHostViewWin::ResetPointerDownContext() { 3152 void RenderWidgetHostViewWin::ResetPointerDownContext() {
3166 // If the default focus on the page is on an edit field and we did not 3153 // If the default focus on the page is on an edit field and we did not
3167 // receive a focus change in the context of a pointer down message, it means 3154 // receive a focus change in the context of a pointer down message, it means
3168 // that the pointer down message occurred on the edit field and we should 3155 // that the pointer down message occurred on the edit field and we should
3169 // display the on screen keyboard 3156 // display the on screen keyboard
3170 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) 3157 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_)
3171 DisplayOnScreenKeyboardIfNeeded(); 3158 DisplayOnScreenKeyboardIfNeeded();
3172 received_focus_change_after_pointer_down_ = false; 3159 received_focus_change_after_pointer_down_ = false;
3173 pointer_down_context_ = false; 3160 pointer_down_context_ = false;
3174 } 3161 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698