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

Side by Side Diff: chrome/browser/extensions/extension_error_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_error_ui.h" 5 #include "chrome/browser/extensions/extension_error_ui.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/string16.h" 8 #include "base/string16.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 string16 ExtensionErrorUI::GenerateMessage() { 56 string16 ExtensionErrorUI::GenerateMessage() {
57 return GenerateMessageSection(external_extension_ids_.get(), 57 return GenerateMessageSection(external_extension_ids_.get(),
58 IDS_EXTENSION_ALERT_ITEM_EXTERNAL, 58 IDS_EXTENSION_ALERT_ITEM_EXTERNAL,
59 IDS_APP_ALERT_ITEM_EXTERNAL) + 59 IDS_APP_ALERT_ITEM_EXTERNAL) +
60 GenerateMessageSection(blacklisted_extension_ids_.get(), 60 GenerateMessageSection(blacklisted_extension_ids_.get(),
61 IDS_EXTENSION_ALERT_ITEM_BLACKLISTED, 61 IDS_EXTENSION_ALERT_ITEM_BLACKLISTED,
62 IDS_APP_ALERT_ITEM_BLACKLISTED); 62 IDS_APP_ALERT_ITEM_BLACKLISTED);
63 } 63 }
64 64
65 string16 ExtensionErrorUI::GetBubbleViewMessage() { 65 std::vector<string16> ExtensionErrorUI::GetBubbleViewMessages() {
66 if (message_.empty()) { 66 if (message_.empty()) {
67 message_ = GenerateMessage(); 67 message_ = GenerateMessage();
68 if (message_[message_.size()-1] == '\n') 68 if (message_[message_.size()-1] == '\n')
69 message_.resize(message_.size()-1); 69 message_.resize(message_.size()-1);
70 } 70 }
71 return message_; 71 return std::vector<string16>(1, message_);
72 } 72 }
73 73
74 string16 ExtensionErrorUI::GetBubbleViewTitle() { 74 string16 ExtensionErrorUI::GetBubbleViewTitle() {
75 return l10n_util::GetStringUTF16(IDS_EXTENSION_ALERT_TITLE); 75 return l10n_util::GetStringUTF16(IDS_EXTENSION_ALERT_TITLE);
76 } 76 }
77 77
78 string16 ExtensionErrorUI::GetBubbleViewAcceptButtonLabel() { 78 string16 ExtensionErrorUI::GetBubbleViewAcceptButtonLabel() {
79 return l10n_util::GetStringUTF16(IDS_EXTENSION_ALERT_ITEM_OK); 79 return l10n_util::GetStringUTF16(IDS_EXTENSION_ALERT_ITEM_OK);
80 } 80 }
81 81
82 string16 ExtensionErrorUI::GetBubbleViewCancelButtonLabel() { 82 string16 ExtensionErrorUI::GetBubbleViewCancelButtonLabel() {
83 return l10n_util::GetStringUTF16(IDS_EXTENSION_ALERT_ITEM_DETAILS); 83 return l10n_util::GetStringUTF16(IDS_EXTENSION_ALERT_ITEM_DETAILS);
84 } 84 }
85 85
86 void ExtensionErrorUI::BubbleViewDidClose() { 86 void ExtensionErrorUI::BubbleViewDidClose() {
87 // This call deletes ExtensionErrorUI object referenced by this. 87 // This call deletes ExtensionErrorUI object referenced by this.
88 extension_service_->HandleExtensionAlertClosed(); 88 extension_service_->HandleExtensionAlertClosed();
89 } 89 }
90 90
91 void ExtensionErrorUI::BubbleViewAcceptButtonPressed() { 91 void ExtensionErrorUI::BubbleViewAcceptButtonPressed() {
92 extension_service_->HandleExtensionAlertAccept(); 92 extension_service_->HandleExtensionAlertAccept();
93 } 93 }
94 94
95 void ExtensionErrorUI::BubbleViewCancelButtonPressed() { 95 void ExtensionErrorUI::BubbleViewCancelButtonPressed() {
96 extension_service_->HandleExtensionAlertDetails(); 96 extension_service_->HandleExtensionAlertDetails();
97 } 97 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698