| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 gfx::NativeWindow parent_window = GetAppListWindow(); |
| 105 if (!parent_window) | 105 if (!parent_window) |
| 106 return; | 106 return; |
| 107 | 107 |
| 108 // For the centered app list, inset the dialog further so it appears as a | |
| 109 // vertical column in the center of the app list. | |
| 110 const int kAppListDialogHorizontalBorderInsets = | |
| 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(); | 108 OnShowChildDialog(); |
| 119 ShowAppInfoDialog(parent_window, | 109 ShowAppInfoDialog(parent_window, |
| 120 dialog_bounds, | 110 GetAppListBounds(), |
| 121 profile, | 111 profile, |
| 122 extension, | 112 extension, |
| 123 base::Bind(&AppListControllerDelegate::OnCloseChildDialog, | 113 base::Bind(&AppListControllerDelegate::OnCloseChildDialog, |
| 124 base::Unretained(this))); | 114 base::Unretained(this))); |
| 125 } | 115 } |
| 126 | 116 |
| 127 void AppListControllerDelegate::UninstallApp(Profile* profile, | 117 void AppListControllerDelegate::UninstallApp(Profile* profile, |
| 128 const std::string& app_id) { | 118 const std::string& app_id) { |
| 129 // ExtensionUninstall deletes itself when done or aborted. | 119 // ExtensionUninstall deletes itself when done or aborted. |
| 130 ExtensionUninstaller* uninstaller = | 120 ExtensionUninstaller* uninstaller = |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 out_apps->InsertAll(registry->enabled_extensions()); | 212 out_apps->InsertAll(registry->enabled_extensions()); |
| 223 out_apps->InsertAll(registry->disabled_extensions()); | 213 out_apps->InsertAll(registry->disabled_extensions()); |
| 224 out_apps->InsertAll(registry->terminated_extensions()); | 214 out_apps->InsertAll(registry->terminated_extensions()); |
| 225 } | 215 } |
| 226 | 216 |
| 227 void AppListControllerDelegate::OnSearchStarted() { | 217 void AppListControllerDelegate::OnSearchStarted() { |
| 228 #if defined(ENABLE_RLZ) | 218 #if defined(ENABLE_RLZ) |
| 229 RLZTracker::RecordAppListSearch(); | 219 RLZTracker::RecordAppListSearch(); |
| 230 #endif | 220 #endif |
| 231 } | 221 } |
| OLD | NEW |