OLD | NEW |
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/web_contents/web_contents_view_win.h" | 5 #include "content/browser/web_contents/web_contents_view_win.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "content/browser/renderer_host/render_view_host_factory.h" | 9 #include "content/browser/renderer_host/render_view_host_factory.h" |
10 #include "content/browser/renderer_host/render_view_host_impl.h" | 10 #include "content/browser/renderer_host/render_view_host_impl.h" |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 // bubble state). | 378 // bubble state). |
379 if (web_contents_->GetDelegate()) { | 379 if (web_contents_->GetDelegate()) { |
380 web_contents_->GetDelegate()->ContentsMouseEvent( | 380 web_contents_->GetDelegate()->ContentsMouseEvent( |
381 web_contents_, | 381 web_contents_, |
382 gfx::Screen::GetNativeScreen()->GetCursorScreenPoint(), | 382 gfx::Screen::GetNativeScreen()->GetCursorScreenPoint(), |
383 true); | 383 true); |
384 } | 384 } |
385 return 0; | 385 return 0; |
386 } | 386 } |
387 | 387 |
388 LRESULT WebContentsViewWin::OnReflectedMessage( | |
389 UINT msg, WPARAM wparam, LPARAM lparam, BOOL& handled) { | |
390 MSG* message = reinterpret_cast<MSG*>(lparam); | |
391 switch (message->message) { | |
392 case WM_MOUSEWHEEL: | |
393 // This message is reflected from the view() to this window. | |
394 if (GET_KEYSTATE_WPARAM(message->wParam) & MK_CONTROL) { | |
395 web_contents_->GetDelegate()->ContentsZoomChange( | |
396 GET_WHEEL_DELTA_WPARAM(message->wParam) > 0); | |
397 return 1; | |
398 } | |
399 break; | |
400 } | |
401 return 0; | |
402 } | |
403 | |
404 LRESULT WebContentsViewWin::OnNCCalcSize( | 388 LRESULT WebContentsViewWin::OnNCCalcSize( |
405 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled) { | 389 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled) { |
406 // Hack for ThinkPad mouse wheel driver. We have set the fake scroll bars | 390 // Hack for ThinkPad mouse wheel driver. We have set the fake scroll bars |
407 // to receive scroll messages from ThinkPad touch-pad driver. Suppress | 391 // to receive scroll messages from ThinkPad touch-pad driver. Suppress |
408 // painting of scrollbars by returning 0 size for them. | 392 // painting of scrollbars by returning 0 size for them. |
409 return 0; | 393 return 0; |
410 } | 394 } |
411 | 395 |
412 LRESULT WebContentsViewWin::OnNCHitTest( | 396 LRESULT WebContentsViewWin::OnNCHitTest( |
413 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled) { | 397 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled) { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 si.nPage = 10; | 458 si.nPage = 10; |
475 si.nPos = 50; | 459 si.nPos = 50; |
476 | 460 |
477 ::SetScrollInfo(hwnd(), SB_HORZ, &si, FALSE); | 461 ::SetScrollInfo(hwnd(), SB_HORZ, &si, FALSE); |
478 ::SetScrollInfo(hwnd(), SB_VERT, &si, FALSE); | 462 ::SetScrollInfo(hwnd(), SB_VERT, &si, FALSE); |
479 | 463 |
480 return 1; | 464 return 1; |
481 } | 465 } |
482 | 466 |
483 } // namespace content | 467 } // namespace content |
OLD | NEW |