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

Side by Side Diff: views/desktop/desktop_window_view.cc

Issue 7462017: views-desktop: Fix sending mousewheel events to the correct view. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "views/desktop/desktop_window_view.h" 5 #include "views/desktop/desktop_window_view.h"
6 6
7 #include "ui/gfx/canvas.h" 7 #include "ui/gfx/canvas.h"
8 #include "ui/gfx/transform.h" 8 #include "ui/gfx/transform.h"
9 #include "views/desktop/desktop_background.h" 9 #include "views/desktop/desktop_background.h"
10 #include "views/desktop/desktop_window_root_view.h" 10 #include "views/desktop/desktop_window_root_view.h"
(...skipping 26 matching lines...) Expand all
37 virtual internal::RootView* CreateRootView() OVERRIDE { 37 virtual internal::RootView* CreateRootView() OVERRIDE {
38 return new DesktopWindowRootView(desktop_window_view_, this); 38 return new DesktopWindowRootView(desktop_window_view_, this);
39 } 39 }
40 40
41 virtual bool OnKeyEvent(const KeyEvent& event) OVERRIDE { 41 virtual bool OnKeyEvent(const KeyEvent& event) OVERRIDE {
42 NativeWidgetViews* native_widget = 42 NativeWidgetViews* native_widget =
43 desktop_window_view_->active_native_widget(); 43 desktop_window_view_->active_native_widget();
44 return native_widget ? native_widget->OnKeyEvent(event) : false; 44 return native_widget ? native_widget->OnKeyEvent(event) : false;
45 } 45 }
46 46
47 virtual bool OnMouseEvent(const MouseEvent& event) {
sky 2011/08/17 15:50:35 OVERRIDE
48 if (event.type() == ui::ET_MOUSEWHEEL) {
49 NativeWidgetViews* native_widget =
50 desktop_window_view_->active_native_widget();
51 if (native_widget)
52 return native_widget->delegate()->OnMouseEvent(event);
53 }
54 return Widget::OnMouseEvent(event);
55 }
56
47 DesktopWindowView* desktop_window_view_; 57 DesktopWindowView* desktop_window_view_;
48 58
49 DISALLOW_COPY_AND_ASSIGN(DesktopWindow); 59 DISALLOW_COPY_AND_ASSIGN(DesktopWindow);
50 }; 60 };
51 61
52 class TestWindowContentView : public WidgetDelegateView { 62 class TestWindowContentView : public WidgetDelegateView {
53 public: 63 public:
54 TestWindowContentView(const std::wstring& title, SkColor color) 64 TestWindowContentView(const std::wstring& title, SkColor color)
55 : title_(title), 65 : title_(title),
56 color_(color) { 66 color_(color) {
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 active_native_widget_->GetWidget()->Deactivate(); 268 active_native_widget_->GetWidget()->Deactivate();
259 active_native_widget_ = 269 active_native_widget_ =
260 static_cast<NativeWidgetViews*>(widget->native_widget()); 270 static_cast<NativeWidgetViews*>(widget->native_widget());
261 } else if (widget == active_native_widget_->GetWidget()) { 271 } else if (widget == active_native_widget_->GetWidget()) {
262 active_native_widget_ = NULL; 272 active_native_widget_ = NULL;
263 } 273 }
264 } 274 }
265 275
266 } // namespace desktop 276 } // namespace desktop
267 } // namespace views 277 } // namespace views
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