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

Side by Side Diff: chrome/browser/extensions/extension_install_ui.cc

Issue 279006: Fix extension canceling; the CFUserNotification functionality gets a bit weir... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 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 | no next file » | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/extensions/extension_install_ui.h" 5 #include "chrome/browser/extensions/extension_install_ui.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 subst.push_back(warnings[base::RandInt(0, arraysize(warnings) - 1)]); 147 subst.push_back(warnings[base::RandInt(0, arraysize(warnings) - 1)]);
148 subst.push_back(l10n_util::GetStringUTF16( 148 subst.push_back(l10n_util::GetStringUTF16(
149 IDS_EXTENSION_PROMPT_WARNING_SEVERE)); 149 IDS_EXTENSION_PROMPT_WARNING_SEVERE));
150 scoped_cftyperef<CFStringRef> confirm_prompt(base::SysUTF16ToCFStringRef( 150 scoped_cftyperef<CFStringRef> confirm_prompt(base::SysUTF16ToCFStringRef(
151 ReplaceStringPlaceholders(confirm_format, subst, NULL))); 151 ReplaceStringPlaceholders(confirm_format, subst, NULL)));
152 152
153 scoped_cftyperef<CFStringRef> confirm_cancel(base::SysWideToCFStringRef( 153 scoped_cftyperef<CFStringRef> confirm_cancel(base::SysWideToCFStringRef(
154 l10n_util::GetString(IDS_EXTENSION_PROMPT_CANCEL_BUTTON))); 154 l10n_util::GetString(IDS_EXTENSION_PROMPT_CANCEL_BUTTON)));
155 155
156 CFOptionFlags response; 156 CFOptionFlags response;
157 if (kCFUserNotificationAlternateResponse == CFUserNotificationDisplayAlert( 157 CFUserNotificationDisplayAlert(
158 0, kCFUserNotificationCautionAlertLevel, 158 0, kCFUserNotificationCautionAlertLevel,
159 NULL, // TODO(port): show the install_icon instead of a default. 159 NULL, // TODO(port): show the install_icon instead of a default.
160 NULL, NULL, // Sound URL, localization URL. 160 NULL, NULL, // Sound URL, localization URL.
161 confirm_title, 161 confirm_title,
162 confirm_prompt, 162 confirm_prompt,
163 NULL, // Default button. 163 NULL, // Default button.
164 confirm_cancel, 164 confirm_cancel,
165 NULL, // Other button. 165 NULL, // Other button.
166 &response)) { 166 &response);
167 if (kCFUserNotificationAlternateResponse == response) {
Mark Mentovai 2009/10/14 22:32:30 We don't usually do (constant == variable), we usu
167 delegate->AbortInstall(); 168 delegate->AbortInstall();
168 } else { 169 } else {
169 delegate->ContinueInstall(); 170 delegate->ContinueInstall();
170 } 171 }
171 #else 172 #else
172 // TODO(port): Implement some UI. 173 // TODO(port): Implement some UI.
173 NOTREACHED(); 174 NOTREACHED();
174 delegate->ContinueInstall(); 175 delegate->ContinueInstall();
175 #endif // OS_* 176 #endif // OS_*
176 } 177 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 #else 238 #else
238 new ThemeInstalledInfoBarDelegate(tab_contents, 239 new ThemeInstalledInfoBarDelegate(tab_contents,
239 new_theme->name(), previous_theme_id_); 240 new_theme->name(), previous_theme_id_);
240 #endif 241 #endif
241 242
242 if (old_delegate) 243 if (old_delegate)
243 tab_contents->ReplaceInfoBar(old_delegate, new_delegate); 244 tab_contents->ReplaceInfoBar(old_delegate, new_delegate);
244 else 245 else
245 tab_contents->AddInfoBar(new_delegate); 246 tab_contents->AddInfoBar(new_delegate);
246 } 247 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698