| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/app_list/search/app_result.h" | 5 #include "chrome/browser/ui/app_list/search/app_result.h" |
| 6 | 6 |
| 7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/extensions/extension_util.h" | 9 #include "chrome/browser/extensions/extension_util.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 content::RecordAction( | 107 content::RecordAction( |
| 108 base::UserMetricsAction("AppList_ClickOnAppFromSearch")); | 108 base::UserMetricsAction("AppList_ClickOnAppFromSearch")); |
| 109 | 109 |
| 110 controller_->ActivateApp( | 110 controller_->ActivateApp( |
| 111 profile_, | 111 profile_, |
| 112 extension, | 112 extension, |
| 113 AppListControllerDelegate::LAUNCH_FROM_APP_LIST_SEARCH, | 113 AppListControllerDelegate::LAUNCH_FROM_APP_LIST_SEARCH, |
| 114 event_flags); | 114 event_flags); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void AppResult::InvokeAction(int action_index, int event_flags) {} | 117 scoped_ptr<SearchResult> AppResult::Duplicate() { |
| 118 | 118 scoped_ptr<SearchResult> copy(new AppResult(profile_, app_id_, controller_)); |
| 119 scoped_ptr<ChromeSearchResult> AppResult::Duplicate() { | |
| 120 scoped_ptr<ChromeSearchResult> copy( | |
| 121 new AppResult(profile_, app_id_, controller_)); | |
| 122 copy->set_title(title()); | 119 copy->set_title(title()); |
| 123 copy->set_title_tags(title_tags()); | 120 copy->set_title_tags(title_tags()); |
| 124 | 121 |
| 125 return copy.Pass(); | 122 return copy.Pass(); |
| 126 } | 123 } |
| 127 | 124 |
| 128 ChromeSearchResultType AppResult::GetType() { | 125 SearchResultType AppResult::GetType() { |
| 129 return APP_SEARCH_RESULT; | 126 return APP_SEARCH_RESULT; |
| 130 } | 127 } |
| 131 | 128 |
| 132 ui::MenuModel* AppResult::GetContextMenuModel() { | 129 ui::MenuModel* AppResult::GetContextMenuModel() { |
| 133 if (!context_menu_) { | 130 if (!context_menu_) { |
| 134 context_menu_.reset(new AppContextMenu( | 131 context_menu_.reset(new AppContextMenu( |
| 135 this, profile_, app_id_, controller_)); | 132 this, profile_, app_id_, controller_)); |
| 136 context_menu_->set_is_platform_app(is_platform_app_); | 133 context_menu_->set_is_platform_app(is_platform_app_); |
| 137 context_menu_->set_is_search_result(true); | 134 context_menu_->set_is_search_result(true); |
| 138 } | 135 } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 211 |
| 215 NotifyItemUninstalled(); | 212 NotifyItemUninstalled(); |
| 216 } | 213 } |
| 217 | 214 |
| 218 void AppResult::OnShutdown(extensions::ExtensionRegistry* registry) { | 215 void AppResult::OnShutdown(extensions::ExtensionRegistry* registry) { |
| 219 DCHECK_EQ(extension_registry_, registry); | 216 DCHECK_EQ(extension_registry_, registry); |
| 220 StopObservingExtensionRegistry(); | 217 StopObservingExtensionRegistry(); |
| 221 } | 218 } |
| 222 | 219 |
| 223 } // namespace app_list | 220 } // namespace app_list |
| OLD | NEW |