Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / ui / app_list / test / app_list_test_view_delegate.cc
index 73b236f..0f4aa5f 100644 (file)
@@ -53,7 +53,8 @@ AppListTestViewDelegate::AppListTestViewDelegate()
     : dismiss_count_(0),
       open_search_result_count_(0),
       test_signin_delegate_(new TestSigninDelegate),
-      model_(new AppListTestModel) {
+      model_(new AppListTestModel),
+      speech_ui_(SPEECH_RECOGNITION_OFF) {
 }
 
 AppListTestViewDelegate::~AppListTestViewDelegate() {}
@@ -88,12 +89,24 @@ void AppListTestViewDelegate::GetShortcutPathForApp(
 }
 
 void AppListTestViewDelegate::OpenSearchResult(SearchResult* result,
+                                               bool auto_launch,
                                                int event_flags) {
+  const AppListModel::SearchResults* results = model_->results();
+  for (size_t i = 0; i < results->item_count(); ++i) {
+    if (results->GetItemAt(i) == result) {
+      open_search_result_counts_[i]++;
+      break;
+    }
+  }
   ++open_search_result_count_;
 }
 
 base::TimeDelta AppListTestViewDelegate::GetAutoLaunchTimeout() {
-  return base::TimeDelta();
+  return auto_launch_timeout_;
+}
+
+void AppListTestViewDelegate::AutoLaunchCanceled() {
+  auto_launch_timeout_ = base::TimeDelta();
 }
 
 void AppListTestViewDelegate::Dismiss() {
@@ -116,6 +129,10 @@ const AppListViewDelegate::Users& AppListTestViewDelegate::GetUsers() const {
   return users_;
 }
 
+bool AppListTestViewDelegate::ShouldCenterWindow() const {
+  return false;
+}
+
 void AppListTestViewDelegate::ReplaceTestModel(int item_count) {
   model_.reset(new AppListTestModel);
   model_->PopulateApps(item_count);