15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef UI_VIEWS_WIDGET_ROOT_VIEW_H_
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define UI_VIEWS_WIDGET_ROOT_VIEW_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <string>
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/memory/ref_counted.h"
11a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "ui/events/event_processor.h"
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/views/focus/focus_manager.h"
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/views/focus/focus_search.h"
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/views/view.h"
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace views {
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
18a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles)namespace test {
19a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles)class WidgetTest;
20a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles)}
21a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles)
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Widget;
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This is a views-internal API and should not be used externally.
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Widget exposes this object as a View*.
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace internal {
27e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdochclass PreEventDispatchHandler;
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)////////////////////////////////////////////////////////////////////////////////
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// RootView class
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//  The RootView is the root of a View hierarchy. A RootView is attached to a
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//  Widget. The Widget is responsible for receiving events from the host
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//  environment, converting them to views-compatible events and then forwarding
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//  them to the RootView for propagation into the View hierarchy.
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//  A RootView can have only one child, called its "Contents View" which is
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//  sized to fill the bounds of the RootView (and hence the client area of the
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//  Widget). Call SetContentsView() after the associated Widget has been
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//  initialized to attach the contents view to the RootView.
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//  TODO(beng): Enforce no other callers to AddChildView/tree functions by
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//              overriding those methods as private here.
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//  TODO(beng): Clean up API further, make Widget a friend.
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//  TODO(sky): We don't really want to export this class.
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class VIEWS_EXPORT RootView : public View,
472a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                              public FocusTraversable,
48a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)                              public ui::EventProcessor {
495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public:
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  static const char kViewClassName[];
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Creation and lifetime -----------------------------------------------------
535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  explicit RootView(Widget* widget);
545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual ~RootView();
555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Tree operations -----------------------------------------------------------
575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Sets the "contents view" of the RootView. This is the single child view
595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // that is responsible for laying out the contents of the widget.
605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void SetContentsView(View* contents_view);
615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  View* GetContentsView();
625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Called when parent of the host changed.
64424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)  void NotifyNativeViewHierarchyChanged();
655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Focus ---------------------------------------------------------------------
675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Used to set the FocusTraversable parent after the view has been created
695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // (typically when the hierarchy changes and this RootView is added/removed).
705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void SetFocusTraversableParent(FocusTraversable* focus_traversable);
715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Used to set the View parent after the view has been created.
735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void SetFocusTraversableParentView(View* view);
745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // System events -------------------------------------------------------------
765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Public API for broadcasting theme change notifications to this View
785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // hierarchy.
795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void ThemeChanged();
805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Public API for broadcasting locale change notifications to this View
825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // hierarchy.
835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void LocaleChanged();
845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Overridden from FocusTraversable:
865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual FocusSearch* GetFocusSearch() OVERRIDE;
875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE;
885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual View* GetFocusTraversableParentView() OVERRIDE;
895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
90a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  // Overridden from ui::EventProcessor:
91a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  virtual ui::EventTarget* GetRootTarget() OVERRIDE;
92a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  virtual ui::EventDispatchDetails OnEventFromSource(ui::Event* event) OVERRIDE;
93a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Overridden from View:
955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual const Widget* GetWidget() const OVERRIDE;
965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual Widget* GetWidget() OVERRIDE;
975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool IsDrawn() const OVERRIDE;
9858537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)  virtual void Layout() OVERRIDE;
99b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)  virtual const char* GetClassName() const OVERRIDE;
1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE;
1015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
1045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnMouseCaptureLost() OVERRIDE;
1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE;
1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE;
1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void SetMouseHandler(View* new_mouse_handler) OVERRIDE;
109a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
11090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  virtual void UpdateParentLayer() OVERRIDE;
1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) protected:
113010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  // TODO(tdanderson): Remove RootView::DispatchGestureEvent() once
114010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  //                   its targeting and dispatch logic has been moved
115010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  //                   elsewhere. See crbug.com/348083.
116a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  virtual void DispatchGestureEvent(ui::GestureEvent* event);
117a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Overridden from View:
119a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)  virtual void ViewHierarchyChanged(
120a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)      const ViewHierarchyChangedDetails& details) OVERRIDE;
121a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles)  virtual void VisibilityChanged(View* starting_from, bool is_visible) OVERRIDE;
1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
1232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual gfx::Vector2d CalculateOffsetToAncestorWithLayer(
1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      ui::Layer** layer_parent) OVERRIDE;
1252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual View::DragInfo* GetDragInfo() OVERRIDE;
1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) private:
12890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  friend class ::views::View;
12990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  friend class ::views::Widget;
130a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles)  friend class ::views::test::WidgetTest;
1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Input ---------------------------------------------------------------------
1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Update the cursor given a mouse event. This is called by non mouse_move
1355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // event handlers to honor the cursor desired by views located under the
1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // cursor during drag operations. The location of the mouse should be in the
1375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // current coordinate system (i.e. any necessary transformation should be
1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // applied to the point prior to calling this).
1395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void UpdateCursor(const ui::MouseEvent& event);
1405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Updates the last_mouse_* fields from e. The location of the mouse should be
1425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // in the current coordinate system (i.e. any necessary transformation should
1435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // be applied to the point prior to calling this).
1445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void SetMouseLocationAndFlags(const ui::MouseEvent& event);
1455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // |view| is the view receiving |event|. This function sends the event to all
1472a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // the Views up the hierarchy that has |notify_enter_exit_on_child_| flag
1482a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // turned on, but does not contain |sibling|.
1492a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  void NotifyEnterExitOfDescendant(const ui::MouseEvent& event,
1502a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                                   ui::EventType type,
1512a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                                   View* view,
1522a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                                   View* sibling);
1532a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Overridden from ui::EventDispatcherDelegate:
1552a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual bool CanDispatchToTarget(ui::EventTarget* target) OVERRIDE;
156a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  virtual ui::EventDispatchDetails PreDispatchEvent(ui::EventTarget* target,
157a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)                                                    ui::Event* event) OVERRIDE;
158a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  virtual ui::EventDispatchDetails PostDispatchEvent(
159a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)      ui::EventTarget* target, const ui::Event& event) OVERRIDE;
1602a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  //////////////////////////////////////////////////////////////////////////////
1625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Tree operations -----------------------------------------------------------
1635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The host Widget
1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  Widget* widget_;
1665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Input ---------------------------------------------------------------------
1685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The view currently handing down - drag - up
1705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  View* mouse_pressed_handler_;
1715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The view currently handling enter / exit
1735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  View* mouse_move_handler_;
1745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The last view to handle a mouse click, so that we can determine if
1765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // a double-click lands on the same view as its single-click part.
1775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  View* last_click_handler_;
1785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // true if mouse_pressed_handler_ has been explicitly set
1805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool explicit_mouse_handler_;
1815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Last position/flag of a mouse press/drag. Used if capture stops and we need
1835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // to synthesize a release.
1845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  int last_mouse_event_flags_;
1855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  int last_mouse_event_x_;
1865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  int last_mouse_event_y_;
1875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The view currently handling gesture events. When set, this handler receives
1895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // all gesture events, except when there is an event handler for the specific
1905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // gesture (e.g. scroll).
1915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  View* gesture_handler_;
1925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The view currently handling scroll gesture events.
1945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  View* scroll_gesture_handler_;
1955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
196e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch  scoped_ptr<internal::PreEventDispatchHandler> pre_dispatch_handler_;
197cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  scoped_ptr<internal::PostEventDispatchHandler> post_dispatch_handler_;
198e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch
1995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Focus ---------------------------------------------------------------------
2005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The focus search algorithm.
2025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  FocusSearch focus_search_;
2035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Whether this root view belongs to the current active window.
2055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // bool activated_;
2065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The parent FocusTraversable, used for focus traversal.
2085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  FocusTraversable* focus_traversable_parent_;
2095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The View that contains this RootView. This is used when we have RootView
2115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // wrapped inside native components, and is used for the focus traversal.
2125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  View* focus_traversable_parent_view_;
2135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  View* event_dispatch_target_;
215a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  View* old_dispatch_target_;
2162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
2175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Drag and drop -------------------------------------------------------------
2185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Tracks drag state for a view.
2205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  View::DragInfo drag_info_;
2215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  DISALLOW_IMPLICIT_CONSTRUCTORS(RootView);
2235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
2245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace internal
2265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace views
2275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // UI_VIEWS_WIDGET_ROOT_VIEW_H_
229