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

Unified Diff: ui/app_list/views/search_result_list_view.h

Issue 645853013: Remove some platform specific stuff from views. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: ui/app_list/views/search_result_list_view.h
diff --git a/ui/app_list/views/search_result_list_view.h b/ui/app_list/views/search_result_list_view.h
deleted file mode 100644
index 40e94149f16c44d26999da1eeb99f3a17ea7bd8e..0000000000000000000000000000000000000000
--- a/ui/app_list/views/search_result_list_view.h
+++ /dev/null
@@ -1,115 +0,0 @@
-// 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_VIEWS_SEARCH_RESULT_LIST_VIEW_H_
-#define UI_APP_LIST_VIEWS_SEARCH_RESULT_LIST_VIEW_H_
-
-#include "base/basictypes.h"
-#include "base/memory/weak_ptr.h"
-#include "ui/app_list/app_list_model.h"
-#include "ui/base/models/list_model_observer.h"
-#include "ui/gfx/animation/animation_delegate.h"
-#include "ui/views/view.h"
-
-namespace gfx {
-class LinearAnimation;
-}
-
-namespace app_list {
-namespace test {
-class SearchResultListViewTest;
-}
-
-class AppListViewDelegate;
-class SearchResultListViewDelegate;
-class SearchResultView;
-
-// SearchResultListView displays SearchResultList with a list of
-// SearchResultView.
-class APP_LIST_EXPORT SearchResultListView : public views::View,
- public gfx::AnimationDelegate,
- public ui::ListModelObserver {
- public:
- SearchResultListView(SearchResultListViewDelegate* delegate,
- AppListViewDelegate* view_delegate);
- virtual ~SearchResultListView();
-
- void SetResults(AppListModel::SearchResults* results);
-
- void SetSelectedIndex(int selected_index);
-
- void UpdateAutoLaunchState();
-
- bool IsResultViewSelected(const SearchResultView* result_view) const;
-
- void SearchResultActivated(SearchResultView* view, int event_flags);
-
- void SearchResultActionActivated(SearchResultView* view,
- size_t action_index,
- int event_flags);
-
- void OnSearchResultInstalled(SearchResultView* view);
-
- void OnSearchResultUninstalled(SearchResultView* view);
-
- // Overridden from views::View:
- virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
- virtual gfx::Size GetPreferredSize() const override;
-
- private:
- friend class test::SearchResultListViewTest;
-
- // Updates the auto launch states.
- void SetAutoLaunchTimeout(const base::TimeDelta& timeout);
- void CancelAutoLaunchTimeout();
-
- // Helper function to get SearchResultView at given |index|.
- SearchResultView* GetResultViewAt(int index);
-
- // Updates UI with model.
- void Update();
-
- // Schedules an Update call using |update_factory_|. Do nothing if there is a
- // pending call.
- void ScheduleUpdate();
-
- // Forcibly auto-launch for test if it is in auto-launching state.
- void ForceAutoLaunchForTest();
-
- // Overridden from views::View:
- virtual void Layout() override;
- virtual int GetHeightForWidth(int w) const override;
- virtual void VisibilityChanged(
- views::View* starting_from, bool is_visible) override;
-
- // Overridden from gfx::AnimationDelegate:
- virtual void AnimationEnded(const gfx::Animation* animation) override;
- virtual void AnimationProgressed(const gfx::Animation* animation) override;
-
- // Overridden from ui::ListModelObserver:
- virtual void ListItemsAdded(size_t start, size_t count) override;
- virtual void ListItemsRemoved(size_t start, size_t count) override;
- virtual void ListItemMoved(size_t index, size_t target_index) override;
- virtual void ListItemsChanged(size_t start, size_t count) override;
-
- SearchResultListViewDelegate* delegate_; // Not owned.
- AppListViewDelegate* view_delegate_; // Not owned.
- AppListModel::SearchResults* results_; // Owned by AppListModel.
-
- views::View* results_container_;
- views::View* auto_launch_indicator_;
- scoped_ptr<gfx::LinearAnimation> auto_launch_animation_;
-
- int last_visible_index_;
- int selected_index_;
-
- // The factory that consolidates multiple Update calls into one.
- base::WeakPtrFactory<SearchResultListView> update_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(SearchResultListView);
-};
-
-} // namespace app_list
-
-#endif // UI_APP_LIST_VIEWS_SEARCH_RESULT_LIST_VIEW_H_
« no previous file with comments | « ui/app_list/views/search_result_actions_view_delegate.h ('k') | ui/app_list/views/search_result_list_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698