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

Side by Side Diff: ui/app_list/views/page_switcher.h

Issue 302803002: Refactor app list so AppsGridView owns the PaginationModel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests and bugs. Created 6 years, 6 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
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 UI_APP_LIST_VIEWS_PAGE_SWITCHER_H_ 5 #ifndef UI_APP_LIST_VIEWS_PAGE_SWITCHER_H_
6 #define UI_APP_LIST_VIEWS_PAGE_SWITCHER_H_ 6 #define UI_APP_LIST_VIEWS_PAGE_SWITCHER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "ui/app_list/pagination_model_observer.h" 9 #include "ui/app_list/pagination_model_observer.h"
10 #include "ui/views/controls/button/button.h" 10 #include "ui/views/controls/button/button.h"
(...skipping 15 matching lines...) Expand all
26 26
27 // Returns the page index of the page switcher button under the point. If no 27 // Returns the page index of the page switcher button under the point. If no
28 // page switcher button is under the point, -1 is return. |point| is in 28 // page switcher button is under the point, -1 is return. |point| is in
29 // PageSwitcher's coordinates. 29 // PageSwitcher's coordinates.
30 int GetPageForPoint(const gfx::Point& point) const; 30 int GetPageForPoint(const gfx::Point& point) const;
31 31
32 // Shows hover for button under the point. |point| is in PageSwitcher's 32 // Shows hover for button under the point. |point| is in PageSwitcher's
33 // coordinates. 33 // coordinates.
34 void UpdateUIForDragPoint(const gfx::Point& point); 34 void UpdateUIForDragPoint(const gfx::Point& point);
35 35
36 // Disconnects the PageSwitcher from its underlying PaginationModel. Can be
37 // used if the PaginationModel is going to be destroyed.
38 void ReleasePaginationModel();
39
36 // Overridden from views::View: 40 // Overridden from views::View:
37 virtual gfx::Size GetPreferredSize() const OVERRIDE; 41 virtual gfx::Size GetPreferredSize() const OVERRIDE;
38 virtual void Layout() OVERRIDE; 42 virtual void Layout() OVERRIDE;
39 43
40 private: 44 private:
41 void CalculateButtonWidthAndSpacing(int contents_width); 45 void CalculateButtonWidthAndSpacing(int contents_width);
42 46
43 // Overridden from views::ButtonListener: 47 // Overridden from views::ButtonListener:
44 virtual void ButtonPressed(views::Button* sender, 48 virtual void ButtonPressed(views::Button* sender,
45 const ui::Event& event) OVERRIDE; 49 const ui::Event& event) OVERRIDE;
46 50
47 // Overridden from PaginationModelObserver: 51 // Overridden from PaginationModelObserver:
48 virtual void TotalPagesChanged() OVERRIDE; 52 virtual void TotalPagesChanged() OVERRIDE;
49 virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE; 53 virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE;
50 virtual void TransitionStarted() OVERRIDE; 54 virtual void TransitionStarted() OVERRIDE;
51 virtual void TransitionChanged() OVERRIDE; 55 virtual void TransitionChanged() OVERRIDE;
52 56
53 PaginationModel* model_; // Owned by AppListController. 57 PaginationModel* model_; // Owned by AppListController; may be NULL.
xiyuan 2014/05/30 15:47:47 Update comments as |model_| is ownded by AppsGridV
Matt Giuca 2014/06/02 07:11:23 Done.
54 views::View* buttons_; // Owned by views hierarchy. 58 views::View* buttons_; // Owned by views hierarchy.
55 59
56 DISALLOW_COPY_AND_ASSIGN(PageSwitcher); 60 DISALLOW_COPY_AND_ASSIGN(PageSwitcher);
57 }; 61 };
58 62
59 } // namespace app_list 63 } // namespace app_list
60 64
61 #endif // UI_APP_LIST_VIEWS_PAGE_SWITCHER_H_ 65 #endif // UI_APP_LIST_VIEWS_PAGE_SWITCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698