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

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

Issue 10560015: Implement base::win::IsMetroProcess. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 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_win.h" 5 #include "content/browser/renderer_host/render_widget_host_view_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <peninputpanel_i.c> 8 #include <peninputpanel_i.c>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 599
600 RenderWidgetHostViewWin::~RenderWidgetHostViewWin() { 600 RenderWidgetHostViewWin::~RenderWidgetHostViewWin() {
601 UnlockMouse(); 601 UnlockMouse();
602 ResetTooltip(); 602 ResetTooltip();
603 } 603 }
604 604
605 void RenderWidgetHostViewWin::CreateWnd(HWND parent) { 605 void RenderWidgetHostViewWin::CreateWnd(HWND parent) {
606 // ATL function to create the window. 606 // ATL function to create the window.
607 Create(parent); 607 Create(parent);
608 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && 608 if (base::win::GetVersion() >= base::win::VERSION_WIN8 &&
609 !base::win::GetMetroModule()) { 609 !base::win::InMetroMode()) {
610 virtual_keyboard_.CreateInstance(CLSID_TextInputPanel, NULL, CLSCTX_INPROC); 610 virtual_keyboard_.CreateInstance(CLSID_TextInputPanel, NULL, CLSCTX_INPROC);
611 if (virtual_keyboard_) { 611 if (virtual_keyboard_) {
612 virtual_keyboard_->put_AttachedEditWindow(m_hWnd); 612 virtual_keyboard_->put_AttachedEditWindow(m_hWnd);
613 virtual_keyboard_->SetInPlaceVisibility(FALSE); 613 virtual_keyboard_->SetInPlaceVisibility(FALSE);
614 } else { 614 } else {
615 NOTREACHED() << "Failed to create instance of pen input panel"; 615 NOTREACHED() << "Failed to create instance of pen input panel";
616 } 616 }
617 } 617 }
618 } 618 }
619 619
(...skipping 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after
2716 TRACE_EVENT0("browser", "RenderWidgetHostViewWin::OnPointerMessage"); 2716 TRACE_EVENT0("browser", "RenderWidgetHostViewWin::OnPointerMessage");
2717 POINT point = {0}; 2717 POINT point = {0};
2718 2718
2719 point.x = GET_X_LPARAM(lparam); 2719 point.x = GET_X_LPARAM(lparam);
2720 point.y = GET_Y_LPARAM(lparam); 2720 point.y = GET_Y_LPARAM(lparam);
2721 ScreenToClient(&point); 2721 ScreenToClient(&point);
2722 2722
2723 lparam = MAKELPARAM(point.x, point.y); 2723 lparam = MAKELPARAM(point.x, point.y);
2724 2724
2725 if (message == WM_POINTERDOWN) { 2725 if (message == WM_POINTERDOWN) {
2726 if (!base::win::GetMetroModule()) { 2726 if (!base::win::InMetroMode()) {
2727 SetFocus(); 2727 SetFocus();
2728 pointer_down_context_ = true; 2728 pointer_down_context_ = true;
2729 received_focus_change_after_pointer_down_ = false; 2729 received_focus_change_after_pointer_down_ = false;
2730 MessageLoop::current()->PostDelayedTask(FROM_HERE, 2730 MessageLoop::current()->PostDelayedTask(FROM_HERE,
2731 base::Bind(&RenderWidgetHostViewWin::ResetPointerDownContext, 2731 base::Bind(&RenderWidgetHostViewWin::ResetPointerDownContext,
2732 weak_factory_.GetWeakPtr()), 2732 weak_factory_.GetWeakPtr()),
2733 base::TimeDelta::FromMilliseconds(kPointerDownContextResetDelay)); 2733 base::TimeDelta::FromMilliseconds(kPointerDownContextResetDelay));
2734 } 2734 }
2735 } 2735 }
2736 handled = FALSE; 2736 handled = FALSE;
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
3084 void RenderWidgetHostViewWin::ResetPointerDownContext() { 3084 void RenderWidgetHostViewWin::ResetPointerDownContext() {
3085 // If the default focus on the page is on an edit field and we did not 3085 // If the default focus on the page is on an edit field and we did not
3086 // receive a focus change in the context of a pointer down message, it means 3086 // receive a focus change in the context of a pointer down message, it means
3087 // that the pointer down message occurred on the edit field and we should 3087 // that the pointer down message occurred on the edit field and we should
3088 // display the on screen keyboard 3088 // display the on screen keyboard
3089 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) 3089 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_)
3090 DisplayOnScreenKeyboardIfNeeded(); 3090 DisplayOnScreenKeyboardIfNeeded();
3091 received_focus_change_after_pointer_down_ = false; 3091 received_focus_change_after_pointer_down_ = false;
3092 pointer_down_context_ = false; 3092 pointer_down_context_ = false;
3093 } 3093 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698