Home | History | Annotate | Download | only in home
      1 // Copyright 2014 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef ATHENA_HOME_APP_LIST_VIEW_DELEGATE_H_
      6 #define ATHENA_HOME_APP_LIST_VIEW_DELEGATE_H_
      7 
      8 #include "base/macros.h"
      9 #include "base/memory/scoped_ptr.h"
     10 #include "ui/app_list/app_list_view_delegate.h"
     11 
     12 namespace app_list {
     13 class SearchProvider;
     14 }
     15 
     16 namespace athena {
     17 class AppModelBuilder;
     18 
     19 class AppListViewDelegate : public app_list::AppListViewDelegate {
     20  public:
     21   explicit AppListViewDelegate(AppModelBuilder* model_builder);
     22   virtual ~AppListViewDelegate();
     23 
     24   void RegisterSearchProvider(app_list::SearchProvider* search_provider);
     25 
     26  private:
     27   void SearchResultChanged();
     28 
     29   // Overridden from app_list::AppListViewDelegate:
     30   virtual bool ForceNativeDesktop() const OVERRIDE;
     31   virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE;
     32   virtual app_list::AppListModel* GetModel() OVERRIDE;
     33   virtual app_list::SpeechUIModel* GetSpeechUI() OVERRIDE;
     34   virtual void GetShortcutPathForApp(
     35       const std::string& app_id,
     36       const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE;
     37   virtual void StartSearch() OVERRIDE;
     38   virtual void StopSearch() OVERRIDE;
     39   virtual void OpenSearchResult(app_list::SearchResult* result,
     40                                 bool auto_launch,
     41                                 int event_flags) OVERRIDE;
     42   virtual void InvokeSearchResultAction(app_list::SearchResult* result,
     43                                         int action_index,
     44                                         int event_flags) OVERRIDE;
     45   virtual base::TimeDelta GetAutoLaunchTimeout() OVERRIDE;
     46   virtual void AutoLaunchCanceled() OVERRIDE;
     47   virtual void ViewInitialized() OVERRIDE;
     48   virtual void Dismiss() OVERRIDE;
     49   virtual void ViewClosing() OVERRIDE;
     50   virtual gfx::ImageSkia GetWindowIcon() OVERRIDE;
     51   virtual void OpenSettings() OVERRIDE;
     52   virtual void OpenHelp() OVERRIDE;
     53   virtual void OpenFeedback() OVERRIDE;
     54   virtual void ToggleSpeechRecognition() OVERRIDE;
     55   virtual void ShowForProfileByPath(
     56       const base::FilePath& profile_path) OVERRIDE;
     57   virtual views::View* CreateStartPageWebView(const gfx::Size& size) OVERRIDE;
     58   virtual std::vector<views::View*> CreateCustomPageWebViews(
     59       const gfx::Size& size) OVERRIDE;
     60   virtual bool IsSpeechRecognitionEnabled() OVERRIDE;
     61   virtual const Users& GetUsers() const OVERRIDE;
     62   virtual bool ShouldCenterWindow() const OVERRIDE;
     63 
     64   scoped_ptr<app_list::AppListModel> model_;
     65   scoped_ptr<app_list::SpeechUIModel> speech_ui_;
     66   Users users_;
     67 
     68   std::vector<app_list::SearchProvider*> search_providers_;
     69 
     70   DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate);
     71 };
     72 
     73 }  // namespace athena
     74 
     75 #endif  // ATHENA_HOME_APP_LIST_VIEW_DELEGATE_H_
     76