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

Side by Side Diff: views/widget/root_view.cc

Issue 8364039: Initial views touchui GestureRecognizer support (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added ForwardGestureEvents()in RootView and incorporated comments Created 9 years, 1 month 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) 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/widget/root_view.h" 5 #include "views/widget/root_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
11 #include "ui/base/accessibility/accessible_view_state.h" 11 #include "ui/base/accessibility/accessible_view_state.h"
12 #include "ui/base/dragdrop/drag_drop_types.h" 12 #include "ui/base/dragdrop/drag_drop_types.h"
13 #include "ui/base/keycodes/keyboard_codes.h" 13 #include "ui/base/keycodes/keyboard_codes.h"
14 #include "ui/gfx/canvas_skia.h" 14 #include "ui/gfx/canvas_skia.h"
15 #include "ui/gfx/compositor/layer.h" 15 #include "ui/gfx/compositor/layer.h"
16 #include "views/focus/view_storage.h" 16 #include "views/focus/view_storage.h"
17 #include "views/layout/fill_layout.h" 17 #include "views/layout/fill_layout.h"
18 #include "views/touchui/gesture_manager.h" 18 #include "views/touchui/gesture_manager.h"
19 #include "views/touchui/gesture_recognizer.h"
19 #include "views/widget/widget.h" 20 #include "views/widget/widget.h"
20 21
21 namespace views { 22 namespace views {
22 namespace internal { 23 namespace internal {
23 24
24 // static 25 // static
25 const char RootView::kViewClassName[] = "views/RootView"; 26 const char RootView::kViewClassName[] = "views/RootView";
26 27
27 //////////////////////////////////////////////////////////////////////////////// 28 ////////////////////////////////////////////////////////////////////////////////
28 // RootView, public: 29 // RootView, public:
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 void RootView::CalculateOffsetToAncestorWithLayer(gfx::Point* offset, 432 void RootView::CalculateOffsetToAncestorWithLayer(gfx::Point* offset,
432 ui::Layer** layer_parent) { 433 ui::Layer** layer_parent) {
433 View::CalculateOffsetToAncestorWithLayer(offset, layer_parent); 434 View::CalculateOffsetToAncestorWithLayer(offset, layer_parent);
434 if (!layer()) 435 if (!layer())
435 widget_->CalculateOffsetToAncestorWithLayer(offset, layer_parent); 436 widget_->CalculateOffsetToAncestorWithLayer(offset, layer_parent);
436 } 437 }
437 438
438 //////////////////////////////////////////////////////////////////////////////// 439 ////////////////////////////////////////////////////////////////////////////////
439 // RootView, private: 440 // RootView, private:
440 441
442 void RootView::ForwardGestureEvents(Gestures* gestures) {
443 scoped_ptr<Gestures> events;
444 events.reset(gestures);
445 for (int i = 0; i < events->size(); i++) {
446 GestureEvent* event = gestures->at(i).GestureEvent();
447 // TODO(Gajen): Identify correct view and call respective view's
rjkroege 2011/10/27 23:10:07 Please don't leave this code out. :-)
Gajen 2011/10/31 13:34:30 Now made this public.
448 // ProcessGestureEvent().
449 }
450 return;
451 }
452
441 // Input ----------------------------------------------------------------------- 453 // Input -----------------------------------------------------------------------
442 454
443 void RootView::UpdateCursor(const MouseEvent& event) { 455 void RootView::UpdateCursor(const MouseEvent& event) {
444 if (!(event.flags() & ui::EF_IS_NON_CLIENT)) { 456 if (!(event.flags() & ui::EF_IS_NON_CLIENT)) {
445 View* v = GetEventHandlerForPoint(event.location()); 457 View* v = GetEventHandlerForPoint(event.location());
446 widget_->SetCursor(v->GetCursor(MouseEvent(event, this, v))); 458 widget_->SetCursor(v->GetCursor(MouseEvent(event, this, v)));
447 } 459 }
448 } 460 }
449 461
450 void RootView::SetMouseLocationAndFlags(const MouseEvent& event) { 462 void RootView::SetMouseLocationAndFlags(const MouseEvent& event) {
451 last_mouse_event_flags_ = event.flags(); 463 last_mouse_event_flags_ = event.flags();
452 last_mouse_event_x_ = event.x(); 464 last_mouse_event_x_ = event.x();
453 last_mouse_event_y_ = event.y(); 465 last_mouse_event_y_ = event.y();
454 } 466 }
455 467
456 } // namespace internal 468 } // namespace internal
457 } // namespace views 469 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698