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

Unified Diff: ui/app_list/contents_view.h

Issue 10534051: app_list: Add transition for apps grid and search results. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/app_list_view.cc ('k') | ui/app_list/contents_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/contents_view.h
diff --git a/ui/app_list/contents_view.h b/ui/app_list/contents_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..fd8be6cd15d8686909b0b9e31353dd46225e3ea2
--- /dev/null
+++ b/ui/app_list/contents_view.h
@@ -0,0 +1,69 @@
+// Copyright (c) 2012 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_APP_LIST_CONTENTS_VIEW_H_
+#define UI_APP_LIST_CONTENTS_VIEW_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "ui/views/view.h"
+
+namespace views {
+class BoundsAnimator;
+class ViewModel;
+}
+
+namespace app_list {
+
+class AppListModel;
+class AppListView;
+class PaginationModel;
+
+// A view to manage sub views under the search box (apps grid view + page
+// switcher and search results). The two sets of sub views are mutually
+// exclusive. ContentsView manages a show state to choose one set to show
+// and animates the transition between show states.
+class ContentsView : public views::View {
+ public:
+ ContentsView(AppListView* app_list_view,
+ PaginationModel* pagination_model);
+ virtual ~ContentsView();
+
+ void SetModel(AppListModel* model);
+
+ void ShowSearchResults(bool show);
+
+ private:
+ enum ShowState {
+ SHOW_APPS,
+ SHOW_SEARCH_RESULTS,
+ };
+
+ // Sets show state.
+ void SetShowState(ShowState show_state);
+
+ // Invoked when show state is changed.
+ void ShowStateChanged();
+
+ void CalculateIdealBounds();
+ void AnimateToIdealBounds();
+
+ // Overridden from views::View:
+ virtual gfx::Size GetPreferredSize() OVERRIDE;
+ virtual void Layout() OVERRIDE;
+ virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE;
+
+ ShowState show_state_;
+
+ scoped_ptr<views::ViewModel> view_model_;
+ scoped_ptr<views::BoundsAnimator> bounds_animator_;
+
+ DISALLOW_COPY_AND_ASSIGN(ContentsView);
+};
+
+} // namespace app_list
+
+#endif // UI_APP_LIST_CONTENTS_VIEW_H_
« no previous file with comments | « ui/app_list/app_list_view.cc ('k') | ui/app_list/contents_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698