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

Side by Side Diff: chrome/browser/ui/app_list/search/app_result.cc

Issue 439703002: Allow app list tiles to show search results in the experimental app list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/app_list/app_list_model.h » ('j') | ui/app_list/app_list_model.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "chrome/browser/ui/app_list/app_context_menu.h" 11 #include "chrome/browser/ui/app_list/app_context_menu.h"
12 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" 12 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
13 #include "chrome/browser/ui/app_list/search/tokenized_string.h" 13 #include "chrome/browser/ui/app_list/search/tokenized_string.h"
14 #include "chrome/browser/ui/app_list/search/tokenized_string_match.h" 14 #include "chrome/browser/ui/app_list/search/tokenized_string_match.h"
15 #include "chrome/browser/ui/extensions/extension_enable_flow.h" 15 #include "chrome/browser/ui/extensions/extension_enable_flow.h"
16 #include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h" 16 #include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h"
17 #include "content/public/browser/user_metrics.h" 17 #include "content/public/browser/user_metrics.h"
18 #include "extensions/browser/extension_registry.h" 18 #include "extensions/browser/extension_registry.h"
19 #include "extensions/browser/extension_system.h" 19 #include "extensions/browser/extension_system.h"
20 #include "extensions/browser/extension_system_provider.h" 20 #include "extensions/browser/extension_system_provider.h"
21 #include "extensions/browser/extensions_browser_client.h" 21 #include "extensions/browser/extensions_browser_client.h"
22 #include "extensions/common/constants.h" 22 #include "extensions/common/constants.h"
23 #include "extensions/common/extension.h" 23 #include "extensions/common/extension.h"
24 #include "extensions/common/extension_icon_set.h" 24 #include "extensions/common/extension_icon_set.h"
25 #include "extensions/common/manifest_handlers/icons_handler.h" 25 #include "extensions/common/manifest_handlers/icons_handler.h"
26 #include "ui/app_list/app_list_switches.h"
26 #include "ui/gfx/color_utils.h" 27 #include "ui/gfx/color_utils.h"
27 #include "ui/gfx/image/image_skia_operations.h" 28 #include "ui/gfx/image/image_skia_operations.h"
28 29
29 namespace app_list { 30 namespace app_list {
30 31
31 AppResult::AppResult(Profile* profile, 32 AppResult::AppResult(Profile* profile,
32 const std::string& app_id, 33 const std::string& app_id,
33 AppListControllerDelegate* controller) 34 AppListControllerDelegate* controller)
34 : profile_(profile), 35 : profile_(profile),
35 app_id_(app_id), 36 app_id_(app_id),
36 controller_(controller), 37 controller_(controller),
37 extension_registry_(NULL) { 38 extension_registry_(NULL) {
38 set_id(extensions::Extension::GetBaseURLFromExtensionId(app_id_).spec()); 39 set_id(extensions::Extension::GetBaseURLFromExtensionId(app_id_).spec());
40 set_display_type(DISPLAY_TILE);
Matt Giuca 2014/08/06 08:54:53 I assume this will have no effect if !IsExperiment
calamity 2014/08/12 05:03:36 Done.
39 41
40 const extensions::Extension* extension = 42 const extensions::Extension* extension =
41 extensions::ExtensionSystem::Get(profile_)->extension_service() 43 extensions::ExtensionSystem::Get(profile_)->extension_service()
42 ->GetInstalledExtension(app_id_); 44 ->GetInstalledExtension(app_id_);
43 DCHECK(extension); 45 DCHECK(extension);
44 46
45 is_platform_app_ = extension->is_platform_app(); 47 is_platform_app_ = extension->is_platform_app();
46 48
47 icon_.reset(new extensions::IconImage( 49 icon_.reset(new extensions::IconImage(
48 profile_, 50 profile_,
49 extension, 51 extension,
50 extensions::IconsInfo::GetIcons(extension), 52 extensions::IconsInfo::GetIcons(extension),
51 extension_misc::EXTENSION_ICON_SMALL, 53 app_list::switches::IsExperimentalAppListEnabled()
54 ? extension_misc::EXTENSION_ICON_MEDIUM
55 : extension_misc::EXTENSION_ICON_SMALL,
52 extensions::util::GetDefaultAppIcon(), 56 extensions::util::GetDefaultAppIcon(),
53 this)); 57 this));
54 UpdateIcon(); 58 UpdateIcon();
55 59
56 StartObservingExtensionRegistry(); 60 StartObservingExtensionRegistry();
57 } 61 }
58 62
59 AppResult::~AppResult() { 63 AppResult::~AppResult() {
60 StopObservingExtensionRegistry(); 64 StopObservingExtensionRegistry();
61 } 65 }
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 215
212 NotifyItemUninstalled(); 216 NotifyItemUninstalled();
213 } 217 }
214 218
215 void AppResult::OnShutdown(extensions::ExtensionRegistry* registry) { 219 void AppResult::OnShutdown(extensions::ExtensionRegistry* registry) {
216 DCHECK_EQ(extension_registry_, registry); 220 DCHECK_EQ(extension_registry_, registry);
217 StopObservingExtensionRegistry(); 221 StopObservingExtensionRegistry();
218 } 222 }
219 223
220 } // namespace app_list 224 } // namespace app_list
OLDNEW
« no previous file with comments | « no previous file | ui/app_list/app_list_model.h » ('j') | ui/app_list/app_list_model.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698