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

Unified Diff: athena/home/home_card_impl.cc

Issue 640103002: Adds full-functional search results for Athena on Chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix DEPS 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
« no previous file with comments | « athena/home/home_card_impl.h ('k') | athena/home/public/home_card.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/home/home_card_impl.cc
diff --git a/athena/home/home_card_impl.cc b/athena/home/home_card_impl.cc
index c96af41085e6b4586e2eba5341572e74ab448be9..1ffbfbf607ebfa79480b52e1f4b0aa0cb39696d7 100644
--- a/athena/home/home_card_impl.cc
+++ b/athena/home/home_card_impl.cc
@@ -16,7 +16,6 @@
#include "athena/screen/public/screen_manager.h"
#include "athena/util/container_priorities.h"
#include "athena/wm/public/window_manager.h"
-#include "ui/app_list/search_provider.h"
#include "ui/app_list/views/app_list_main_view.h"
#include "ui/app_list/views/contents_view.h"
#include "ui/aura/layout_manager.h"
@@ -222,8 +221,10 @@ class HomeCardView : public views::WidgetDelegateView {
DISALLOW_COPY_AND_ASSIGN(HomeCardView);
};
-HomeCardImpl::HomeCardImpl(AppModelBuilder* model_builder)
- : model_builder_(model_builder),
+HomeCardImpl::HomeCardImpl(scoped_ptr<AppModelBuilder> model_builder,
+ scoped_ptr<SearchControllerFactory> search_factory)
+ : model_builder_(model_builder.Pass()),
+ search_factory_(search_factory.Pass()),
state_(HIDDEN),
original_state_(VISIBLE_MINIMIZED),
home_card_widget_(NULL),
@@ -245,7 +246,6 @@ HomeCardImpl::~HomeCardImpl() {
// Reset the view delegate first as it access search provider during
// shutdown.
view_delegate_.reset();
- search_provider_.reset();
instance = NULL;
}
@@ -259,9 +259,8 @@ void HomeCardImpl::Init() {
container->SetLayoutManager(layout_manager_);
wm::SetChildWindowVisibilityChangesAnimated(container);
- view_delegate_.reset(new AppListViewDelegate(model_builder_.get()));
- if (search_provider_)
- view_delegate_->RegisterSearchProvider(search_provider_.get());
+ view_delegate_.reset(
+ new AppListViewDelegate(model_builder_.get(), search_factory_.get()));
home_card_view_ = new HomeCardView(view_delegate_.get(), container, this);
home_card_widget_ = new views::Widget();
@@ -339,13 +338,6 @@ HomeCard::State HomeCardImpl::GetState() {
return state_;
}
-void HomeCardImpl::RegisterSearchProvider(
- app_list::SearchProvider* search_provider) {
- DCHECK(!search_provider_);
- search_provider_.reset(search_provider);
- view_delegate_->RegisterSearchProvider(search_provider_.get());
-}
-
void HomeCardImpl::UpdateVirtualKeyboardBounds(
const gfx::Rect& bounds) {
if (state_ == VISIBLE_MINIMIZED && !bounds.IsEmpty()) {
@@ -437,8 +429,9 @@ void HomeCardImpl::OnWindowActivated(aura::Window* gained_active,
}
// static
-HomeCard* HomeCard::Create(AppModelBuilder* model_builder) {
- (new HomeCardImpl(model_builder))->Init();
+HomeCard* HomeCard::Create(scoped_ptr<AppModelBuilder> model_builder,
+ scoped_ptr<SearchControllerFactory> search_factory) {
+ (new HomeCardImpl(model_builder.Pass(), search_factory.Pass()))->Init();
DCHECK(instance);
return instance;
}
« no previous file with comments | « athena/home/home_card_impl.h ('k') | athena/home/public/home_card.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698