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

Unified Diff: chrome/browser/ui/ash/app_list/app_list_view_delegate.cc

Issue 10871011: Move common app_list delegate code to chrome/browser/ui/app_list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Unit test file only in chrome Created 8 years, 4 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: chrome/browser/ui/ash/app_list/app_list_view_delegate.cc
diff --git a/chrome/browser/ui/ash/app_list/app_list_view_delegate.cc b/chrome/browser/ui/ash/app_list/app_list_view_delegate.cc
deleted file mode 100644
index c67caaf9a981a5cb2329b06296b1f748ce6b403e..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/ash/app_list/app_list_view_delegate.cc
+++ /dev/null
@@ -1,62 +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.
-
-#include "chrome/browser/ui/ash/app_list/app_list_view_delegate.h"
-
-#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/ui/ash/app_list/apps_model_builder.h"
-#include "chrome/browser/ui/ash/app_list/chrome_app_list_item.h"
-#include "chrome/browser/ui/ash/app_list/search_builder.h"
-#include "content/public/browser/user_metrics.h"
-
-AppListViewDelegate::AppListViewDelegate(AppListController* controller)
- : controller_(controller) {}
-
-AppListViewDelegate::~AppListViewDelegate() {}
-
-void AppListViewDelegate::SetModel(app_list::AppListModel* model) {
- if (model) {
- Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord();
- apps_builder_.reset(new AppsModelBuilder(profile,
- model->apps(),
- controller_.get()));
- apps_builder_->Build();
-
- search_builder_.reset(new SearchBuilder(profile,
- model->search_box(),
- model->results(),
- controller_.get()));
- } else {
- apps_builder_.reset();
- search_builder_.reset();
- }
-}
-
-void AppListViewDelegate::ActivateAppListItem(
- app_list::AppListItemModel* item,
- int event_flags) {
- content::RecordAction(content::UserMetricsAction("AppList_ClickOnApp"));
- static_cast<ChromeAppListItem*>(item)->Activate(event_flags);
-}
-
-void AppListViewDelegate::StartSearch() {
- if (search_builder_.get())
- search_builder_->StartSearch();
-}
-
-void AppListViewDelegate::StopSearch() {
- if (search_builder_.get())
- search_builder_->StopSearch();
-}
-
-void AppListViewDelegate::OpenSearchResult(
- const app_list::SearchResult& result,
- int event_flags) {
- if (search_builder_.get())
- search_builder_->OpenResult(result, event_flags);
-}
-
-void AppListViewDelegate::Close() {
- controller_->CloseView();
-}
« no previous file with comments | « chrome/browser/ui/ash/app_list/app_list_view_delegate.h ('k') | chrome/browser/ui/ash/app_list/apps_model_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698