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

Side by Side Diff: chrome/browser/ui/app_list/extension_app_item.cc

Issue 2894743002: Make launching apps from shelf more intuitive (Closed)
Patch Set: Affected by new revision, gclient sync and re-upload. Created 3 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extension_app_item.h" 5 #include "chrome/browser/ui/app_list/extension_app_item.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/metrics/user_metrics.h" 10 #include "base/metrics/user_metrics.h"
(...skipping 12 matching lines...) Expand all
23 #include "components/prefs/pref_service.h" 23 #include "components/prefs/pref_service.h"
24 #include "components/sync/model/string_ordinal.h" 24 #include "components/sync/model/string_ordinal.h"
25 #include "extensions/browser/app_sorting.h" 25 #include "extensions/browser/app_sorting.h"
26 #include "extensions/browser/extension_prefs.h" 26 #include "extensions/browser/extension_prefs.h"
27 #include "extensions/browser/extension_registry.h" 27 #include "extensions/browser/extension_registry.h"
28 #include "extensions/common/extension.h" 28 #include "extensions/common/extension.h"
29 #include "extensions/common/extension_icon_set.h" 29 #include "extensions/common/extension_icon_set.h"
30 #include "extensions/common/manifest_handlers/icons_handler.h" 30 #include "extensions/common/manifest_handlers/icons_handler.h"
31 #include "extensions/common/manifest_url_handlers.h" 31 #include "extensions/common/manifest_url_handlers.h"
32 #include "ui/base/resource/resource_bundle.h" 32 #include "ui/base/resource/resource_bundle.h"
33 #include "ui/display/types/display_constants.h"
33 #include "ui/events/event_constants.h" 34 #include "ui/events/event_constants.h"
34 #include "ui/gfx/canvas.h" 35 #include "ui/gfx/canvas.h"
35 #include "ui/gfx/geometry/rect.h" 36 #include "ui/gfx/geometry/rect.h"
36 #include "ui/gfx/image/canvas_image_source.h" 37 #include "ui/gfx/image/canvas_image_source.h"
37 #include "ui/gfx/skia_util.h" 38 #include "ui/gfx/skia_util.h"
38 39
39 using extensions::Extension; 40 using extensions::Extension;
40 41
41 ExtensionAppItem::ExtensionAppItem( 42 ExtensionAppItem::ExtensionAppItem(
42 Profile* profile, 43 Profile* profile,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 if (!extension) 114 if (!extension)
114 return; 115 return;
115 116
116 // Don't auto-enable apps that cannot be launched. 117 // Don't auto-enable apps that cannot be launched.
117 if (!extensions::util::IsAppLaunchable(extension_id(), profile())) 118 if (!extensions::util::IsAppLaunchable(extension_id(), profile()))
118 return; 119 return;
119 120
120 if (RunExtensionEnableFlow()) 121 if (RunExtensionEnableFlow())
121 return; 122 return;
122 123
123 GetController()->LaunchApp(profile(), 124 GetController()->LaunchApp(profile(), extension,
124 extension,
125 AppListControllerDelegate::LAUNCH_FROM_APP_LIST, 125 AppListControllerDelegate::LAUNCH_FROM_APP_LIST,
126 event_flags); 126 event_flags, display::kInvalidDisplayId);
127 } 127 }
128 128
129 void ExtensionAppItem::ExtensionEnableFlowFinished() { 129 void ExtensionAppItem::ExtensionEnableFlowFinished() {
130 extension_enable_flow_.reset(); 130 extension_enable_flow_.reset();
131 extension_enable_flow_controller_->OnCloseChildDialog(); 131 extension_enable_flow_controller_->OnCloseChildDialog();
132 extension_enable_flow_controller_ = NULL; 132 extension_enable_flow_controller_ = NULL;
133 133
134 // Automatically launch app after enabling. 134 // Automatically launch app after enabling.
135 Launch(ui::EF_NONE); 135 Launch(ui::EF_NONE);
136 } 136 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 // static 174 // static
175 const char ExtensionAppItem::kItemType[] = "ExtensionAppItem"; 175 const char ExtensionAppItem::kItemType[] = "ExtensionAppItem";
176 176
177 const char* ExtensionAppItem::GetItemType() const { 177 const char* ExtensionAppItem::GetItemType() const {
178 return ExtensionAppItem::kItemType; 178 return ExtensionAppItem::kItemType;
179 } 179 }
180 180
181 void ExtensionAppItem::ExecuteLaunchCommand(int event_flags) { 181 void ExtensionAppItem::ExecuteLaunchCommand(int event_flags) {
182 Launch(event_flags); 182 Launch(event_flags);
183 } 183 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698