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

Side by Side Diff: ash/shelf/shelf_view.h

Issue 598013003: Added views::ViewModelT<T>, a type-safe template version of ViewModel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@appsgridview-static-casts
Patch Set: DISALLOW_COPY_AND_ASSIGN. Created 6 years, 2 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
« no previous file with comments | « no previous file | ash/shelf/shelf_view.cc » ('j') | ui/views/view_model.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 ASH_SHELF_SHELF_VIEW_H_ 5 #ifndef ASH_SHELF_SHELF_VIEW_H_
6 #define ASH_SHELF_SHELF_VIEW_H_ 6 #define ASH_SHELF_SHELF_VIEW_H_
7 7
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "ash/shelf/shelf_button_host.h" 11 #include "ash/shelf/shelf_button_host.h"
12 #include "ash/shelf/shelf_model_observer.h" 12 #include "ash/shelf/shelf_model_observer.h"
13 #include "ash/wm/gestures/shelf_gesture_handler.h" 13 #include "ash/wm/gestures/shelf_gesture_handler.h"
14 #include "base/observer_list.h" 14 #include "base/observer_list.h"
15 #include "ui/app_list/views/app_list_drag_and_drop_host.h" 15 #include "ui/app_list/views/app_list_drag_and_drop_host.h"
16 #include "ui/views/animation/bounds_animator_observer.h" 16 #include "ui/views/animation/bounds_animator_observer.h"
17 #include "ui/views/context_menu_controller.h" 17 #include "ui/views/context_menu_controller.h"
18 #include "ui/views/controls/button/button.h" 18 #include "ui/views/controls/button/button.h"
19 #include "ui/views/focus/focus_manager.h" 19 #include "ui/views/focus/focus_manager.h"
20 #include "ui/views/view.h" 20 #include "ui/views/view.h"
21 #include "ui/views/view_model.h"
21 22
22 namespace ui { 23 namespace ui {
23 class MenuModel; 24 class MenuModel;
24 } 25 }
25 26
26 namespace views { 27 namespace views {
27 class BoundsAnimator; 28 class BoundsAnimator;
28 class MenuRunner; 29 class MenuRunner;
29 class ViewModel;
30 } 30 }
31 31
32 namespace ash { 32 namespace ash {
33 class ShelfDelegate; 33 class ShelfDelegate;
34 class ShelfIconObserver; 34 class ShelfIconObserver;
35 class ShelfItemDelegateManager; 35 class ShelfItemDelegateManager;
36 class ShelfModel; 36 class ShelfModel;
37 struct ShelfItem; 37 struct ShelfItem;
38 class DragImageView; 38 class DragImageView;
39 class OverflowBubble; 39 class OverflowBubble;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 virtual void UpdateDragIconProxy( 126 virtual void UpdateDragIconProxy(
127 const gfx::Point& location_in_screen_coordinates) OVERRIDE; 127 const gfx::Point& location_in_screen_coordinates) OVERRIDE;
128 virtual void DestroyDragIconProxy() OVERRIDE; 128 virtual void DestroyDragIconProxy() OVERRIDE;
129 virtual bool StartDrag( 129 virtual bool StartDrag(
130 const std::string& app_id, 130 const std::string& app_id,
131 const gfx::Point& location_in_screen_coordinates) OVERRIDE; 131 const gfx::Point& location_in_screen_coordinates) OVERRIDE;
132 virtual bool Drag(const gfx::Point& location_in_screen_coordinates) OVERRIDE; 132 virtual bool Drag(const gfx::Point& location_in_screen_coordinates) OVERRIDE;
133 virtual void EndDrag(bool cancel) OVERRIDE; 133 virtual void EndDrag(bool cancel) OVERRIDE;
134 134
135 // Return the view model for test purposes. 135 // Return the view model for test purposes.
136 const views::ViewModel* view_model_for_test() const { 136 const views::ViewModel<views::View>* view_model_for_test() const {
137 return view_model_.get(); 137 return view_model_.get();
138 } 138 }
139 139
140 private: 140 private:
141 friend class ash::test::ShelfViewTestAPI; 141 friend class ash::test::ShelfViewTestAPI;
142 142
143 class FadeOutAnimationDelegate; 143 class FadeOutAnimationDelegate;
144 class StartFadeAnimationDelegate; 144 class StartFadeAnimationDelegate;
145 145
146 struct IdealBounds { 146 struct IdealBounds {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 int CalculateShelfDistance(const gfx::Point& coordinate) const; 324 int CalculateShelfDistance(const gfx::Point& coordinate) const;
325 325
326 // The model; owned by Launcher. 326 // The model; owned by Launcher.
327 ShelfModel* model_; 327 ShelfModel* model_;
328 328
329 // Delegate; owned by Launcher. 329 // Delegate; owned by Launcher.
330 ShelfDelegate* delegate_; 330 ShelfDelegate* delegate_;
331 331
332 // Used to manage the set of active launcher buttons. There is a view per 332 // Used to manage the set of active launcher buttons. There is a view per
333 // item in |model_|. 333 // item in |model_|.
334 scoped_ptr<views::ViewModel> view_model_; 334 scoped_ptr<views::ViewModel<views::View>> view_model_;
335 335
336 // Index of first visible launcher item. 336 // Index of first visible launcher item.
337 int first_visible_index_; 337 int first_visible_index_;
338 338
339 // Last index of a launcher button that is visible 339 // Last index of a launcher button that is visible
340 // (does not go into overflow). 340 // (does not go into overflow).
341 mutable int last_visible_index_; 341 mutable int last_visible_index_;
342 342
343 scoped_ptr<views::BoundsAnimator> bounds_animator_; 343 scoped_ptr<views::BoundsAnimator> bounds_animator_;
344 344
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 439
440 // True when ripped item from overflow bubble is entered into Shelf. 440 // True when ripped item from overflow bubble is entered into Shelf.
441 bool dragged_off_from_overflow_to_shelf_; 441 bool dragged_off_from_overflow_to_shelf_;
442 442
443 DISALLOW_COPY_AND_ASSIGN(ShelfView); 443 DISALLOW_COPY_AND_ASSIGN(ShelfView);
444 }; 444 };
445 445
446 } // namespace ash 446 } // namespace ash
447 447
448 #endif // ASH_SHELF_SHELF_VIEW_H_ 448 #endif // ASH_SHELF_SHELF_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | ash/shelf/shelf_view.cc » ('j') | ui/views/view_model.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698