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 #ifndef UI_VIEWS_CONTROLS_TREE_TREE_VIEW_VIEWS_H_ | 5 #ifndef UI_VIEWS_CONTROLS_TREE_TREE_VIEW_VIEWS_H_ |
6 #define UI_VIEWS_CONTROLS_TREE_TREE_VIEW_VIEWS_H_ | 6 #define UI_VIEWS_CONTROLS_TREE_TREE_VIEW_VIEWS_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 // Returns the node for the specified row, or NULL for an invalid row index. | 114 // Returns the node for the specified row, or NULL for an invalid row index. |
115 ui::TreeModelNode* GetNodeForRow(int row); | 115 ui::TreeModelNode* GetNodeForRow(int row); |
116 | 116 |
117 // Maps a node to a row, returns -1 if node is not valid. | 117 // Maps a node to a row, returns -1 if node is not valid. |
118 int GetRowForNode(ui::TreeModelNode* node); | 118 int GetRowForNode(ui::TreeModelNode* node); |
119 | 119 |
120 views::Textfield* editor() { return editor_; } | 120 views::Textfield* editor() { return editor_; } |
121 | 121 |
122 // View overrides: | 122 // View overrides: |
123 virtual void Layout() OVERRIDE; | 123 virtual void Layout() override; |
124 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 124 virtual gfx::Size GetPreferredSize() const override; |
125 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 125 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
126 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 126 virtual bool OnMousePressed(const ui::MouseEvent& event) override; |
127 virtual ui::TextInputClient* GetTextInputClient() OVERRIDE; | 127 virtual ui::TextInputClient* GetTextInputClient() override; |
128 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 128 virtual void OnGestureEvent(ui::GestureEvent* event) override; |
129 virtual void ShowContextMenu(const gfx::Point& p, | 129 virtual void ShowContextMenu(const gfx::Point& p, |
130 ui::MenuSourceType source_type) OVERRIDE; | 130 ui::MenuSourceType source_type) override; |
131 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 131 virtual void GetAccessibleState(ui::AXViewState* state) override; |
132 virtual const char* GetClassName() const OVERRIDE; | 132 virtual const char* GetClassName() const override; |
133 | 133 |
134 // TreeModelObserver overrides: | 134 // TreeModelObserver overrides: |
135 virtual void TreeNodesAdded(ui::TreeModel* model, | 135 virtual void TreeNodesAdded(ui::TreeModel* model, |
136 ui::TreeModelNode* parent, | 136 ui::TreeModelNode* parent, |
137 int start, | 137 int start, |
138 int count) OVERRIDE; | 138 int count) override; |
139 virtual void TreeNodesRemoved(ui::TreeModel* model, | 139 virtual void TreeNodesRemoved(ui::TreeModel* model, |
140 ui::TreeModelNode* parent, | 140 ui::TreeModelNode* parent, |
141 int start, | 141 int start, |
142 int count) OVERRIDE; | 142 int count) override; |
143 virtual void TreeNodeChanged(ui::TreeModel* model, | 143 virtual void TreeNodeChanged(ui::TreeModel* model, |
144 ui::TreeModelNode* model_node) OVERRIDE; | 144 ui::TreeModelNode* model_node) override; |
145 | 145 |
146 // TextfieldController overrides: | 146 // TextfieldController overrides: |
147 virtual void ContentsChanged(Textfield* sender, | 147 virtual void ContentsChanged(Textfield* sender, |
148 const base::string16& new_contents) OVERRIDE; | 148 const base::string16& new_contents) override; |
149 virtual bool HandleKeyEvent(Textfield* sender, | 149 virtual bool HandleKeyEvent(Textfield* sender, |
150 const ui::KeyEvent& key_event) OVERRIDE; | 150 const ui::KeyEvent& key_event) override; |
151 | 151 |
152 // FocusChangeListener overrides: | 152 // FocusChangeListener overrides: |
153 virtual void OnWillChangeFocus(View* focused_before, | 153 virtual void OnWillChangeFocus(View* focused_before, |
154 View* focused_now) OVERRIDE; | 154 View* focused_now) override; |
155 virtual void OnDidChangeFocus(View* focused_before, | 155 virtual void OnDidChangeFocus(View* focused_before, |
156 View* focused_now) OVERRIDE; | 156 View* focused_now) override; |
157 | 157 |
158 // PrefixDelegate overrides: | 158 // PrefixDelegate overrides: |
159 virtual int GetRowCount() OVERRIDE; | 159 virtual int GetRowCount() override; |
160 virtual int GetSelectedRow() OVERRIDE; | 160 virtual int GetSelectedRow() override; |
161 virtual void SetSelectedRow(int row) OVERRIDE; | 161 virtual void SetSelectedRow(int row) override; |
162 virtual base::string16 GetTextForRow(int row) OVERRIDE; | 162 virtual base::string16 GetTextForRow(int row) override; |
163 | 163 |
164 protected: | 164 protected: |
165 // View overrides: | 165 // View overrides: |
166 virtual gfx::Point GetKeyboardContextMenuLocation() OVERRIDE; | 166 virtual gfx::Point GetKeyboardContextMenuLocation() override; |
167 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 167 virtual bool OnKeyPressed(const ui::KeyEvent& event) override; |
168 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 168 virtual void OnPaint(gfx::Canvas* canvas) override; |
169 virtual void OnFocus() OVERRIDE; | 169 virtual void OnFocus() override; |
170 virtual void OnBlur() OVERRIDE; | 170 virtual void OnBlur() override; |
171 | 171 |
172 private: | 172 private: |
173 friend class TreeViewTest; | 173 friend class TreeViewTest; |
174 | 174 |
175 // Selects, expands or collapses nodes in the tree. Consistent behavior for | 175 // Selects, expands or collapses nodes in the tree. Consistent behavior for |
176 // tap gesture and click events. | 176 // tap gesture and click events. |
177 bool OnClickOrTap(const ui::LocatedEvent& event); | 177 bool OnClickOrTap(const ui::LocatedEvent& event); |
178 | 178 |
179 // InternalNode is used to track information about the set of nodes displayed | 179 // InternalNode is used to track information about the set of nodes displayed |
180 // by TreeViewViews. | 180 // by TreeViewViews. |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 int text_offset_; | 388 int text_offset_; |
389 | 389 |
390 scoped_ptr<PrefixSelector> selector_; | 390 scoped_ptr<PrefixSelector> selector_; |
391 | 391 |
392 DISALLOW_COPY_AND_ASSIGN(TreeView); | 392 DISALLOW_COPY_AND_ASSIGN(TreeView); |
393 }; | 393 }; |
394 | 394 |
395 } // namespace views | 395 } // namespace views |
396 | 396 |
397 #endif // UI_VIEWS_CONTROLS_TREE_TREE_VIEW_VIEWS_H_ | 397 #endif // UI_VIEWS_CONTROLS_TREE_TREE_VIEW_VIEWS_H_ |
OLD | NEW |