| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/tab_contents/tab_contents_view_win.h" | 5 #include "chrome/browser/views/tab_contents/tab_contents_view_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/browser/browser.h" // TODO(beng): this dependency is awful. | 10 #include "chrome/browser/browser.h" // TODO(beng): this dependency is awful. |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 MapWindowPoints(GetNativeView(), HWND_DESKTOP, &screen_pt, 1); | 336 MapWindowPoints(GetNativeView(), HWND_DESKTOP, &screen_pt, 1); |
| 337 | 337 |
| 338 // Enable recursive tasks on the message loop so we can get updates while | 338 // Enable recursive tasks on the message loop so we can get updates while |
| 339 // the context menu is being displayed. | 339 // the context menu is being displayed. |
| 340 bool old_state = MessageLoop::current()->NestableTasksAllowed(); | 340 bool old_state = MessageLoop::current()->NestableTasksAllowed(); |
| 341 MessageLoop::current()->SetNestableTasksAllowed(true); | 341 MessageLoop::current()->SetNestableTasksAllowed(true); |
| 342 context_menu_->RunMenuAt(screen_pt.x, screen_pt.y); | 342 context_menu_->RunMenuAt(screen_pt.x, screen_pt.y); |
| 343 MessageLoop::current()->SetNestableTasksAllowed(old_state); | 343 MessageLoop::current()->SetNestableTasksAllowed(old_state); |
| 344 } | 344 } |
| 345 | 345 |
| 346 void TabContentsViewWin::ShowPopupMenu(const gfx::Rect& bounds, |
| 347 int item_height, |
| 348 double item_font_size, |
| 349 int selected_item, |
| 350 const std::vector<WebMenuItem>& items, |
| 351 bool right_aligned) { |
| 352 // External popup menus are only used on Mac. |
| 353 NOTREACHED(); |
| 354 } |
| 355 |
| 346 void TabContentsViewWin::OnHScroll(int scroll_type, short position, | 356 void TabContentsViewWin::OnHScroll(int scroll_type, short position, |
| 347 HWND scrollbar) { | 357 HWND scrollbar) { |
| 348 ScrollCommon(WM_HSCROLL, scroll_type, position, scrollbar); | 358 ScrollCommon(WM_HSCROLL, scroll_type, position, scrollbar); |
| 349 } | 359 } |
| 350 | 360 |
| 351 void TabContentsViewWin::OnMouseLeave() { | 361 void TabContentsViewWin::OnMouseLeave() { |
| 352 // Let our delegate know that the mouse moved (useful for resetting status | 362 // Let our delegate know that the mouse moved (useful for resetting status |
| 353 // bubble state). | 363 // bubble state). |
| 354 if (tab_contents()->delegate()) | 364 if (tab_contents()->delegate()) |
| 355 tab_contents()->delegate()->ContentsMouseEvent( | 365 tab_contents()->delegate()->ContentsMouseEvent( |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 } | 566 } |
| 557 return false; | 567 return false; |
| 558 } | 568 } |
| 559 | 569 |
| 560 void TabContentsViewWin::WheelZoom(int distance) { | 570 void TabContentsViewWin::WheelZoom(int distance) { |
| 561 if (tab_contents()->delegate()) { | 571 if (tab_contents()->delegate()) { |
| 562 bool zoom_in = distance > 0; | 572 bool zoom_in = distance > 0; |
| 563 tab_contents()->delegate()->ContentsZoomChange(zoom_in); | 573 tab_contents()->delegate()->ContentsZoomChange(zoom_in); |
| 564 } | 574 } |
| 565 } | 575 } |
| OLD | NEW |