Chromium Code Reviews| 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, | |
| 121 profile, | 110 profile, |
| 122 extension, | 111 extension, |
| 123 base::Bind(&AppListControllerDelegate::OnCloseChildDialog, | 112 base::Bind(&AppListControllerDelegate::OnCloseChildDialog, |
|
tapted
2014/06/16 01:05:43
Since it's now fetching the controller delegate in
| |
| 124 base::Unretained(this))); | 113 base::Unretained(this))); |
| 125 } | 114 } |
| 126 | 115 |
| 127 void AppListControllerDelegate::UninstallApp(Profile* profile, | 116 void AppListControllerDelegate::UninstallApp(Profile* profile, |
| 128 const std::string& app_id) { | 117 const std::string& app_id) { |
| 129 // ExtensionUninstall deletes itself when done or aborted. | 118 // ExtensionUninstall deletes itself when done or aborted. |
| 130 ExtensionUninstaller* uninstaller = | 119 ExtensionUninstaller* uninstaller = |
| 131 new ExtensionUninstaller(profile, app_id, this); | 120 new ExtensionUninstaller(profile, app_id, this); |
| 132 uninstaller->Run(); | 121 uninstaller->Run(); |
| 133 } | 122 } |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 222 out_apps->InsertAll(registry->enabled_extensions()); | 211 out_apps->InsertAll(registry->enabled_extensions()); |
| 223 out_apps->InsertAll(registry->disabled_extensions()); | 212 out_apps->InsertAll(registry->disabled_extensions()); |
| 224 out_apps->InsertAll(registry->terminated_extensions()); | 213 out_apps->InsertAll(registry->terminated_extensions()); |
| 225 } | 214 } |
| 226 | 215 |
| 227 void AppListControllerDelegate::OnSearchStarted() { | 216 void AppListControllerDelegate::OnSearchStarted() { |
| 228 #if defined(ENABLE_RLZ) | 217 #if defined(ENABLE_RLZ) |
| 229 RLZTracker::RecordAppListSearch(); | 218 RLZTracker::RecordAppListSearch(); |
| 230 #endif | 219 #endif |
| 231 } | 220 } |
| OLD | NEW |