OLD | NEW |
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/app_list_controller_delegate.h" | 5 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/extensions/extension_util.h" | 8 #include "chrome/browser/extensions/extension_util.h" |
9 #include "chrome/browser/extensions/install_tracker_factory.h" | 9 #include "chrome/browser/extensions/install_tracker_factory.h" |
10 #include "chrome/browser/extensions/launch_util.h" | 10 #include "chrome/browser/extensions/launch_util.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 Profile* profile, | 94 Profile* profile, |
95 const std::string& extension_id) { | 95 const std::string& extension_id) { |
96 DCHECK(CanDoShowAppInfoFlow()); | 96 DCHECK(CanDoShowAppInfoFlow()); |
97 ExtensionService* service = | 97 ExtensionService* service = |
98 extensions::ExtensionSystem::Get(profile)->extension_service(); | 98 extensions::ExtensionSystem::Get(profile)->extension_service(); |
99 DCHECK(service); | 99 DCHECK(service); |
100 const extensions::Extension* extension = service->GetInstalledExtension( | 100 const extensions::Extension* extension = service->GetInstalledExtension( |
101 extension_id); | 101 extension_id); |
102 DCHECK(extension); | 102 DCHECK(extension); |
103 | 103 |
104 gfx::NativeWindow parent_window = GetAppListWindow(); | 104 OnShowChildDialog(); |
105 if (!parent_window) | |
106 return; | |
107 | 105 |
108 // For the centered app list, inset the dialog further so it appears as a | 106 // Since the AppListControllerDelegate is a leaky singleton, passing its |
109 // vertical column in the center of the app list. | 107 // raw pointer around is OK. |
110 const int kAppListDialogHorizontalBorderInsets = | 108 ShowAppInfoDialog(this, profile, extension); |
111 app_list::switches::IsCenteredAppListEnabled() ? 110 : 10; | |
112 const int kAppListDialogVerticalBorderInsets = 10; | |
113 | |
114 gfx::Rect dialog_bounds = GetAppListBounds(); | |
115 dialog_bounds.Inset(kAppListDialogHorizontalBorderInsets, | |
116 kAppListDialogVerticalBorderInsets); | |
117 | |
118 OnShowChildDialog(); | |
119 ShowAppInfoDialog(parent_window, | |
120 dialog_bounds, | |
121 profile, | |
122 extension, | |
123 base::Bind(&AppListControllerDelegate::OnCloseChildDialog, | |
124 base::Unretained(this))); | |
125 } | 109 } |
126 | 110 |
127 void AppListControllerDelegate::UninstallApp(Profile* profile, | 111 void AppListControllerDelegate::UninstallApp(Profile* profile, |
128 const std::string& app_id) { | 112 const std::string& app_id) { |
129 // ExtensionUninstall deletes itself when done or aborted. | 113 // ExtensionUninstall deletes itself when done or aborted. |
130 ExtensionUninstaller* uninstaller = | 114 ExtensionUninstaller* uninstaller = |
131 new ExtensionUninstaller(profile, app_id, this); | 115 new ExtensionUninstaller(profile, app_id, this); |
132 uninstaller->Run(); | 116 uninstaller->Run(); |
133 } | 117 } |
134 | 118 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 out_apps->InsertAll(registry->enabled_extensions()); | 206 out_apps->InsertAll(registry->enabled_extensions()); |
223 out_apps->InsertAll(registry->disabled_extensions()); | 207 out_apps->InsertAll(registry->disabled_extensions()); |
224 out_apps->InsertAll(registry->terminated_extensions()); | 208 out_apps->InsertAll(registry->terminated_extensions()); |
225 } | 209 } |
226 | 210 |
227 void AppListControllerDelegate::OnSearchStarted() { | 211 void AppListControllerDelegate::OnSearchStarted() { |
228 #if defined(ENABLE_RLZ) | 212 #if defined(ENABLE_RLZ) |
229 RLZTracker::RecordAppListSearch(); | 213 RLZTracker::RecordAppListSearch(); |
230 #endif | 214 #endif |
231 } | 215 } |
OLD | NEW |