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

Side by Side Diff: chrome/browser/ui/views/page_info_bubble_view.cc

Issue 6088008: Remove wstring from l10n_util. Part 7.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/views/page_info_bubble_view.h" 5 #include "chrome/browser/views/page_info_bubble_view.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/browser_list.h" 9 #include "chrome/browser/browser_list.h"
10 #include "chrome/browser/cert_store.h" 10 #include "chrome/browser/cert_store.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 // Add separator after all sections. 148 // Add separator after all sections.
149 layout->AddPaddingRow(0, kPaddingAboveSeparator); 149 layout->AddPaddingRow(0, kPaddingAboveSeparator);
150 layout->StartRow(0, 0); 150 layout->StartRow(0, 0);
151 layout->AddView(new views::Separator()); 151 layout->AddView(new views::Separator());
152 layout->AddPaddingRow(0, kPaddingBelowSeparator); 152 layout->AddPaddingRow(0, kPaddingBelowSeparator);
153 } 153 }
154 154
155 // Then add the help center link at the bottom. 155 // Then add the help center link at the bottom.
156 layout->StartRow(0, 1); 156 layout->StartRow(0, 1);
157 help_center_link_ = 157 help_center_link_ = new views::Link(
158 new views::Link(l10n_util::GetString(IDS_PAGE_INFO_HELP_CENTER_LINK)); 158 UTF16ToWide(l10n_util::GetStringUTF16(IDS_PAGE_INFO_HELP_CENTER_LINK)));
159 help_center_link_->SetController(this); 159 help_center_link_->SetController(this);
160 layout->AddView(help_center_link_); 160 layout->AddView(help_center_link_);
161 } 161 }
162 162
163 gfx::Size PageInfoBubbleView::GetPreferredSize() { 163 gfx::Size PageInfoBubbleView::GetPreferredSize() {
164 gfx::Size size(views::Window::GetLocalizedContentsSize( 164 gfx::Size size(views::Window::GetLocalizedContentsSize(
165 IDS_PAGEINFOBUBBLE_WIDTH_CHARS, IDS_PAGEINFOBUBBLE_HEIGHT_LINES)); 165 IDS_PAGEINFOBUBBLE_WIDTH_CHARS, IDS_PAGEINFOBUBBLE_HEIGHT_LINES));
166 size.set_height(0); 166 size.set_height(0);
167 167
168 int count = model_.GetSectionCount(); 168 int count = model_.GetSectionCount();
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 description_label_ = new views::Label(UTF16ToWideHack(info_.description)); 247 description_label_ = new views::Label(UTF16ToWideHack(info_.description));
248 description_label_->SetMultiLine(true); 248 description_label_->SetMultiLine(true);
249 description_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); 249 description_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
250 // Allow linebreaking in the middle of words if necessary, so that extremely 250 // Allow linebreaking in the middle of words if necessary, so that extremely
251 // long hostnames (longer than one line) will still be completely shown. 251 // long hostnames (longer than one line) will still be completely shown.
252 description_label_->SetAllowCharacterBreak(true); 252 description_label_->SetAllowCharacterBreak(true);
253 AddChildView(description_label_); 253 AddChildView(description_label_);
254 254
255 if (info_.type == PageInfoModel::SECTION_INFO_IDENTITY && show_cert) { 255 if (info_.type == PageInfoModel::SECTION_INFO_IDENTITY && show_cert) {
256 link_ = new views::Link( 256 link_ = new views::Link(
257 l10n_util::GetString(IDS_PAGEINFO_CERT_INFO_BUTTON)); 257 UTF16ToWide(l10n_util::GetStringUTF16(IDS_PAGEINFO_CERT_INFO_BUTTON)));
258 link_->SetController(this); 258 link_->SetController(this);
259 AddChildView(link_); 259 AddChildView(link_);
260 } 260 }
261 } 261 }
262 262
263 Section::~Section() { 263 Section::~Section() {
264 } 264 }
265 265
266 int Section::GetHeightForWidth(int width) { 266 int Section::GetHeightForWidth(int width) {
267 return LayoutItems(true, width).height(); 267 return LayoutItems(true, width).height();
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 PageInfoBubbleView* page_info_bubble = 346 PageInfoBubbleView* page_info_bubble =
347 new PageInfoBubbleView(parent, profile, url, ssl, show_history); 347 new PageInfoBubbleView(parent, profile, url, ssl, show_history);
348 InfoBubble* info_bubble = 348 InfoBubble* info_bubble =
349 InfoBubble::Show(browser_view->GetWidget(), bounds, 349 InfoBubble::Show(browser_view->GetWidget(), bounds,
350 BubbleBorder::TOP_LEFT, 350 BubbleBorder::TOP_LEFT,
351 page_info_bubble, page_info_bubble); 351 page_info_bubble, page_info_bubble);
352 page_info_bubble->set_info_bubble(info_bubble); 352 page_info_bubble->set_info_bubble(info_bubble);
353 } 353 }
354 354
355 } 355 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698