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

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

Issue 14262009: Add support for multi-line GlobalError messages to Views. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
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/extensions/extension_disabled_ui.h" 5 #include "chrome/browser/extensions/extension_disabled_ui.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 // GlobalError implementation. 136 // GlobalError implementation.
137 virtual Severity GetSeverity() OVERRIDE; 137 virtual Severity GetSeverity() OVERRIDE;
138 virtual bool HasMenuItem() OVERRIDE; 138 virtual bool HasMenuItem() OVERRIDE;
139 virtual int MenuItemCommandID() OVERRIDE; 139 virtual int MenuItemCommandID() OVERRIDE;
140 virtual string16 MenuItemLabel() OVERRIDE; 140 virtual string16 MenuItemLabel() OVERRIDE;
141 virtual int MenuItemIconResourceID() OVERRIDE; 141 virtual int MenuItemIconResourceID() OVERRIDE;
142 virtual void ExecuteMenuItem(Browser* browser) OVERRIDE; 142 virtual void ExecuteMenuItem(Browser* browser) OVERRIDE;
143 virtual bool HasBubbleView() OVERRIDE; 143 virtual bool HasBubbleView() OVERRIDE;
144 virtual string16 GetBubbleViewTitle() OVERRIDE; 144 virtual string16 GetBubbleViewTitle() OVERRIDE;
145 virtual string16 GetBubbleViewMessage() OVERRIDE; 145 virtual std::vector<string16> GetBubbleViewMessages() OVERRIDE;
146 virtual string16 GetBubbleViewAcceptButtonLabel() OVERRIDE; 146 virtual string16 GetBubbleViewAcceptButtonLabel() OVERRIDE;
147 virtual string16 GetBubbleViewCancelButtonLabel() OVERRIDE; 147 virtual string16 GetBubbleViewCancelButtonLabel() OVERRIDE;
148 virtual void OnBubbleViewDidClose(Browser* browser) OVERRIDE; 148 virtual void OnBubbleViewDidClose(Browser* browser) OVERRIDE;
149 virtual void BubbleViewAcceptButtonPressed(Browser* browser) OVERRIDE; 149 virtual void BubbleViewAcceptButtonPressed(Browser* browser) OVERRIDE;
150 virtual void BubbleViewCancelButtonPressed(Browser* browser) OVERRIDE; 150 virtual void BubbleViewCancelButtonPressed(Browser* browser) OVERRIDE;
151 151
152 // ExtensionUninstallDialog::Delegate implementation. 152 // ExtensionUninstallDialog::Delegate implementation.
153 virtual void ExtensionUninstallAccepted() OVERRIDE; 153 virtual void ExtensionUninstallAccepted() OVERRIDE;
154 virtual void ExtensionUninstallCanceled() OVERRIDE; 154 virtual void ExtensionUninstallCanceled() OVERRIDE;
155 155
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 226
227 bool ExtensionDisabledGlobalError::HasBubbleView() { 227 bool ExtensionDisabledGlobalError::HasBubbleView() {
228 return true; 228 return true;
229 } 229 }
230 230
231 string16 ExtensionDisabledGlobalError::GetBubbleViewTitle() { 231 string16 ExtensionDisabledGlobalError::GetBubbleViewTitle() {
232 return l10n_util::GetStringFUTF16(IDS_EXTENSION_DISABLED_ERROR_TITLE, 232 return l10n_util::GetStringFUTF16(IDS_EXTENSION_DISABLED_ERROR_TITLE,
233 UTF8ToUTF16(extension_->name())); 233 UTF8ToUTF16(extension_->name()));
234 } 234 }
235 235
236 string16 ExtensionDisabledGlobalError::GetBubbleViewMessage() { 236 std::vector<string16> ExtensionDisabledGlobalError::GetBubbleViewMessages() {
237 return l10n_util::GetStringFUTF16(extension_->is_app() ? 237 string16 message = l10n_util::GetStringFUTF16(
238 extension_->is_app() ?
238 IDS_APP_DISABLED_ERROR_LABEL : IDS_EXTENSION_DISABLED_ERROR_LABEL, 239 IDS_APP_DISABLED_ERROR_LABEL : IDS_EXTENSION_DISABLED_ERROR_LABEL,
239 UTF8ToUTF16(extension_->name())); 240 UTF8ToUTF16(extension_->name()));
241 return std::vector<string16>(1, message);
240 } 242 }
241 243
242 string16 ExtensionDisabledGlobalError::GetBubbleViewAcceptButtonLabel() { 244 string16 ExtensionDisabledGlobalError::GetBubbleViewAcceptButtonLabel() {
243 return l10n_util::GetStringUTF16( 245 return l10n_util::GetStringUTF16(
244 IDS_EXTENSION_DISABLED_ERROR_ENABLE_BUTTON); 246 IDS_EXTENSION_DISABLED_ERROR_ENABLE_BUTTON);
245 } 247 }
246 248
247 string16 ExtensionDisabledGlobalError::GetBubbleViewCancelButtonLabel() { 249 string16 ExtensionDisabledGlobalError::GetBubbleViewCancelButtonLabel() {
248 return l10n_util::GetStringUTF16(IDS_EXTENSIONS_UNINSTALL); 250 return l10n_util::GetStringUTF16(IDS_EXTENSIONS_UNINSTALL);
249 } 251 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 void ShowExtensionDisabledDialog(ExtensionService* service, 321 void ShowExtensionDisabledDialog(ExtensionService* service,
320 content::WebContents* web_contents, 322 content::WebContents* web_contents,
321 const Extension* extension) { 323 const Extension* extension) {
322 scoped_ptr<ExtensionInstallPrompt> install_ui( 324 scoped_ptr<ExtensionInstallPrompt> install_ui(
323 new ExtensionInstallPrompt(web_contents)); 325 new ExtensionInstallPrompt(web_contents));
324 // This object manages its own lifetime. 326 // This object manages its own lifetime.
325 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension); 327 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension);
326 } 328 }
327 329
328 } // namespace extensions 330 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_error_ui.h » ('j') | chrome/browser/ui/global_error/global_error.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698