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

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

Issue 306023011: Add new DialogDelegate for dialogs in the App List (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit comment Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/app_list_controller_delegate_views.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/app_list_controller_delegate_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698