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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 extensions::ExtensionSystem::Get(profile)->extension_service(); | 92 extensions::ExtensionSystem::Get(profile)->extension_service(); |
93 DCHECK(service); | 93 DCHECK(service); |
94 const extensions::Extension* extension = service->GetInstalledExtension( | 94 const extensions::Extension* extension = service->GetInstalledExtension( |
95 extension_id); | 95 extension_id); |
96 DCHECK(extension); | 96 DCHECK(extension); |
97 | 97 |
98 gfx::NativeWindow parent_window = GetAppListWindow(); | 98 gfx::NativeWindow parent_window = GetAppListWindow(); |
99 if (!parent_window) | 99 if (!parent_window) |
100 return; | 100 return; |
101 | 101 |
102 // The dialog is inset so the app list is still visible around the edges. | |
103 unsigned int kAppListDialogHorizontalBorderInsets = 10; | |
tapted
2014/05/21 03:40:57
nit: just `int` is fine - shouldn't use unsigned i
sashab
2014/05/22 07:20:21
Done.
| |
104 unsigned int kAppListDialogVerticalBorderInsets = 10; | |
105 | |
106 // If we are using the experimental app list, inset the dialog further so it | |
107 // appears as a vertical column in the center of the app list. | |
108 if (app_list::switches::IsExperimentalAppListEnabled()) { | |
tapted
2014/05/21 03:40:57
this should check IsCenteredAppListEnabled() inste
sashab
2014/05/22 07:20:21
Yes, you're right! Good find! Done :)
| |
109 kAppListDialogHorizontalBorderInsets += 100; | |
tapted
2014/05/21 03:40:57
Hm - I would make them both actually const. e.g.
sashab
2014/05/22 07:20:21
Done.
| |
110 } | |
111 | |
112 gfx::Rect dialog_bounds = GetAppListBounds(); | |
113 dialog_bounds.Inset(kAppListDialogHorizontalBorderInsets, | |
114 kAppListDialogVerticalBorderInsets); | |
115 | |
102 OnShowExtensionPrompt(); | 116 OnShowExtensionPrompt(); |
103 ShowAppInfoDialog( | 117 ShowAppInfoDialog( |
104 parent_window, | 118 parent_window, |
119 dialog_bounds, | |
105 profile, | 120 profile, |
106 extension, | 121 extension, |
107 base::Bind(&AppListControllerDelegate::OnCloseExtensionPrompt, | 122 base::Bind(&AppListControllerDelegate::OnCloseExtensionPrompt, |
108 base::Unretained(this))); | 123 base::Unretained(this))); |
109 } | 124 } |
110 | 125 |
111 void AppListControllerDelegate::UninstallApp(Profile* profile, | 126 void AppListControllerDelegate::UninstallApp(Profile* profile, |
112 const std::string& app_id) { | 127 const std::string& app_id) { |
113 // ExtensionUninstall deletes itself when done or aborted. | 128 // ExtensionUninstall deletes itself when done or aborted. |
114 ExtensionUninstaller* uninstaller = | 129 ExtensionUninstaller* uninstaller = |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
206 out_apps->InsertAll(registry->enabled_extensions()); | 221 out_apps->InsertAll(registry->enabled_extensions()); |
207 out_apps->InsertAll(registry->disabled_extensions()); | 222 out_apps->InsertAll(registry->disabled_extensions()); |
208 out_apps->InsertAll(registry->terminated_extensions()); | 223 out_apps->InsertAll(registry->terminated_extensions()); |
209 } | 224 } |
210 | 225 |
211 void AppListControllerDelegate::OnSearchStarted() { | 226 void AppListControllerDelegate::OnSearchStarted() { |
212 #if defined(ENABLE_RLZ) | 227 #if defined(ENABLE_RLZ) |
213 RLZTracker::RecordAppListSearch(); | 228 RLZTracker::RecordAppListSearch(); |
214 #endif | 229 #endif |
215 } | 230 } |
OLD | NEW |