| Index: ui/aura_shell/app_list/tiles_page_view.h
|
| diff --git a/ui/aura_shell/app_list/tiles_page_view.h b/ui/aura_shell/app_list/tiles_page_view.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c6b5645b01671ca641676078db7867a196009c12
|
| --- /dev/null
|
| +++ b/ui/aura_shell/app_list/tiles_page_view.h
|
| @@ -0,0 +1,61 @@
|
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef UI_AURA_SHELL_APP_LIST_TILES_PAGE_VIEW_H_
|
| +#define UI_AURA_SHELL_APP_LIST_TILES_PAGE_VIEW_H_
|
| +#pragma once
|
| +
|
| +#include "ui/aura_shell/aura_shell_export.h"
|
| +#include "ui/base/models/list_model_observer.h"
|
| +#include "ui/views/view.h"
|
| +
|
| +namespace aura_shell {
|
| +
|
| +class AppListItemGroupModel;
|
| +
|
| +// TilesPageView displays its children tiles in a grid.
|
| +class AURA_SHELL_EXPORT TilesPageView : public views::View,
|
| + public ui::ListModelObserver {
|
| + public:
|
| + explicit TilesPageView(AppListItemGroupModel* model);
|
| + virtual ~TilesPageView();
|
| +
|
| + // Sets tiles per row.
|
| + void SetTilesPerRow(int tiles_per_row);
|
| +
|
| + // Gets currently focused tile.
|
| + views::View* GetFocusedTile();
|
| +
|
| + // Updates tiles page when a tile gets focus.
|
| + void UpdateFocusedTile(views::View* tile);
|
| +
|
| + private:
|
| + // Updates from model.
|
| + void Update();
|
| +
|
| + // Sets focused tile by index.
|
| + void SetFocusedTileByIndex(int index);
|
| +
|
| + // Overridden from views::View:
|
| + virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE;
|
| +
|
| + // Overridden from ListModelObserver:
|
| + virtual void ListItemsAdded(int start, int count) OVERRIDE;
|
| + virtual void ListItemsRemoved(int start, int count) OVERRIDE;
|
| + virtual void ListItemsChanged(int start, int count) OVERRIDE;
|
| +
|
| + AppListItemGroupModel* model_;
|
| +
|
| + // Tiles per row.
|
| + int tiles_per_row_;
|
| +
|
| + // Index of focused tile view.
|
| + int focused_index_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(TilesPageView);
|
| +};
|
| +
|
| +} // namespace aura_shell
|
| +
|
| +#endif // UI_AURA_SHELL_APP_LIST_TILES_PAGE_VIEW_H_
|
|
|