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

Unified Diff: ui/app_list/apps_grid_view.h

Issue 10386224: app_list: Add search box and search result view for v2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win_aura Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/app_list_view_delegate.h ('k') | ui/app_list/apps_grid_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/apps_grid_view.h
diff --git a/ui/app_list/app_list_model_view.h b/ui/app_list/apps_grid_view.h
similarity index 79%
rename from ui/app_list/app_list_model_view.h
rename to ui/app_list/apps_grid_view.h
index 89fc7f6f4a5f7550148fe4ed6cc11004b0b69d51..bfefe407f5089335206142f1d6c22d701233d1c9 100644
--- a/ui/app_list/app_list_model_view.h
+++ b/ui/app_list/apps_grid_view.h
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_APP_LIST_APP_LIST_MODEL_VIEW_H_
-#define UI_APP_LIST_APP_LIST_MODEL_VIEW_H_
+#ifndef UI_APP_LIST_APPS_GRID_VIEW_H_
+#define UI_APP_LIST_APPS_GRID_VIEW_H_
#pragma once
#include "ui/app_list/app_list_export.h"
+#include "ui/app_list/app_list_model.h"
#include "ui/app_list/pagination_model_observer.h"
#include "ui/base/models/list_model_observer.h"
#include "ui/views/view.h"
@@ -18,17 +19,16 @@ class ButtonListener;
namespace app_list {
class AppListItemView;
-class AppListModel;
class PaginationModel;
-// AppListModelView displays the UI for an AppListModel.
-class APP_LIST_EXPORT AppListModelView : public views::View,
- public ui::ListModelObserver,
- public PaginationModelObserver {
+// AppsGridView displays a grid for AppListModel::Apps sub model.
+class APP_LIST_EXPORT AppsGridView : public views::View,
+ public ui::ListModelObserver,
+ public PaginationModelObserver {
public:
- AppListModelView(views::ButtonListener* listener,
+ AppsGridView(views::ButtonListener* listener,
PaginationModel* pagination_model);
tfarina 2012/05/25 19:17:23 nit: fix indent here.
- virtual ~AppListModelView();
+ virtual ~AppsGridView();
// Calculate preferred icon size, rows and cols for given |content_size| and
// |num_of_tiles|.
@@ -43,7 +43,7 @@ class APP_LIST_EXPORT AppListModelView : public views::View,
void SetLayout(int icon_size, int cols, int rows_per_page);
// Sets |model| to use. Note this does not take ownership of |model|.
- void SetModel(AppListModel* model);
+ void SetModel(AppListModel::Apps* model);
void SetSelectedItem(AppListItemView* item);
void ClearSelectedItem(AppListItemView* item);
@@ -56,13 +56,6 @@ class APP_LIST_EXPORT AppListModelView : public views::View,
return fixed_layout_;
}
- private:
- // Updates from model.
- void Update();
-
- AppListItemView* GetItemViewAtIndex(int index);
- void SetSelectedItemByIndex(int index);
-
// Overridden from views::View:
virtual gfx::Size GetPreferredSize() OVERRIDE;
virtual void Layout() OVERRIDE;
@@ -70,6 +63,13 @@ class APP_LIST_EXPORT AppListModelView : public views::View,
virtual bool OnKeyReleased(const views::KeyEvent& event) OVERRIDE;
virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE;
+ private:
+ // Updates from model.
+ void Update();
+
+ AppListItemView* GetItemViewAtIndex(int index);
+ void SetSelectedItemByIndex(int index);
+
// Overridden from ListModelObserver:
virtual void ListItemsAdded(size_t start, size_t count) OVERRIDE;
virtual void ListItemsRemoved(size_t start, size_t count) OVERRIDE;
@@ -79,7 +79,7 @@ class APP_LIST_EXPORT AppListModelView : public views::View,
virtual void TotalPagesChanged() OVERRIDE;
virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE;
- AppListModel* model_; // Owned by parent AppListView.
+ AppListModel::Apps* model_; // Owned by AppListModel.
views::ButtonListener* listener_;
PaginationModel* pagination_model_; // Owned by AppListView.
@@ -90,9 +90,9 @@ class APP_LIST_EXPORT AppListModelView : public views::View,
int selected_item_index_;
- DISALLOW_COPY_AND_ASSIGN(AppListModelView);
+ DISALLOW_COPY_AND_ASSIGN(AppsGridView);
};
} // namespace app_list
-#endif // UI_APP_LIST_APP_LIST_MODEL_VIEW_H_
+#endif // UI_APP_LIST_APPS_GRID_VIEW_H_
« no previous file with comments | « ui/app_list/app_list_view_delegate.h ('k') | ui/app_list/apps_grid_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698