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

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

Issue 2849713003: Move all Page Info strings into page_info_strings.grdp (Closed)
Patch Set: Fix moar. Created 3 years, 7 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
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/views/page_info/page_info_bubble_view.h" 5 #include "chrome/browser/ui/views/page_info/page_info_bubble_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 if (!ui::MaterialDesignController::IsSecondaryUiMaterial()) 282 if (!ui::MaterialDesignController::IsSecondaryUiMaterial())
283 link_style.font_style |= gfx::Font::FontStyle::UNDERLINE; 283 link_style.font_style |= gfx::Font::FontStyle::UNDERLINE;
284 link_style.disable_line_wrapping = false; 284 link_style.disable_line_wrapping = false;
285 285
286 details_label_->AddStyleRange(details_range, link_style); 286 details_label_->AddStyleRange(details_range, link_style);
287 } 287 }
288 288
289 void BubbleHeaderView::AddResetDecisionsLabel() { 289 void BubbleHeaderView::AddResetDecisionsLabel() {
290 std::vector<base::string16> subst; 290 std::vector<base::string16> subst;
291 subst.push_back( 291 subst.push_back(
292 l10n_util::GetStringUTF16(IDS_PAGEINFO_INVALID_CERTIFICATE_DESCRIPTION)); 292 l10n_util::GetStringUTF16(IDS_PAGE_INFO_INVALID_CERTIFICATE_DESCRIPTION));
293 subst.push_back(l10n_util::GetStringUTF16( 293 subst.push_back(l10n_util::GetStringUTF16(
294 IDS_PAGEINFO_RESET_INVALID_CERTIFICATE_DECISIONS_BUTTON)); 294 IDS_PAGE_INFO_RESET_INVALID_CERTIFICATE_DECISIONS_BUTTON));
295 295
296 std::vector<size_t> offsets; 296 std::vector<size_t> offsets;
297 297
298 base::string16 text = base::ReplaceStringPlaceholders( 298 base::string16 text = base::ReplaceStringPlaceholders(
299 base::ASCIIToUTF16("$1 $2"), subst, &offsets); 299 base::ASCIIToUTF16("$1 $2"), subst, &offsets);
300 reset_decisions_label_ = new views::StyledLabel(text, styled_label_listener_); 300 reset_decisions_label_ = new views::StyledLabel(text, styled_label_listener_);
301 reset_decisions_label_->set_id(STYLED_LABEL_RESET_CERTIFICATE_DECISIONS); 301 reset_decisions_label_->set_id(STYLED_LABEL_RESET_CERTIFICATE_DECISIONS);
302 gfx::Range link_range(offsets[1], text.length()); 302 gfx::Range link_range(offsets[1], text.length());
303 303
304 views::StyledLabel::RangeStyleInfo link_style = 304 views::StyledLabel::RangeStyleInfo link_style =
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 PageInfoUI::PermissionInfo info; 723 PageInfoUI::PermissionInfo info;
724 info.type = CONTENT_SETTINGS_TYPE_COOKIES; 724 info.type = CONTENT_SETTINGS_TYPE_COOKIES;
725 info.setting = CONTENT_SETTING_ALLOW; 725 info.setting = CONTENT_SETTING_ALLOW;
726 info.is_incognito = 726 info.is_incognito =
727 Profile::FromBrowserContext(web_contents()->GetBrowserContext()) 727 Profile::FromBrowserContext(web_contents()->GetBrowserContext())
728 ->IsOffTheRecord(); 728 ->IsOffTheRecord();
729 729
730 const gfx::ImageSkia icon = PageInfoUI::GetPermissionIcon(info).AsImageSkia(); 730 const gfx::ImageSkia icon = PageInfoUI::GetPermissionIcon(info).AsImageSkia();
731 // Add the Cookies section. 731 // Add the Cookies section.
732 site_settings_view->AddChildView(CreateInspectLinkSection( 732 site_settings_view->AddChildView(CreateInspectLinkSection(
733 icon, IDS_PAGE_INFO_TITLE_SITE_DATA, cookie_dialog_link_)); 733 icon, IDS_PAGE_INFO_COOKIES, cookie_dialog_link_));
734 734
735 return site_settings_view; 735 return site_settings_view;
736 } 736 }
737 737
738 void PageInfoBubbleView::HandleLinkClickedAsync(views::Link* source) { 738 void PageInfoBubbleView::HandleLinkClickedAsync(views::Link* source) {
739 // All switch cases require accessing web_contents(), so we check it here. 739 // All switch cases require accessing web_contents(), so we check it here.
740 if (web_contents() == nullptr || web_contents()->IsBeingDestroyed()) 740 if (web_contents() == nullptr || web_contents()->IsBeingDestroyed())
741 return; 741 return;
742 switch (source->id()) { 742 switch (source->id()) {
743 case LINK_SITE_SETTINGS: 743 case LINK_SITE_SETTINGS:
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 PageInfo::PAGE_INFO_CONNECTION_HELP_OPENED); 785 PageInfo::PAGE_INFO_CONNECTION_HELP_OPENED);
786 break; 786 break;
787 case STYLED_LABEL_RESET_CERTIFICATE_DECISIONS: 787 case STYLED_LABEL_RESET_CERTIFICATE_DECISIONS:
788 presenter_->OnRevokeSSLErrorBypassButtonPressed(); 788 presenter_->OnRevokeSSLErrorBypassButtonPressed();
789 GetWidget()->Close(); 789 GetWidget()->Close();
790 break; 790 break;
791 default: 791 default:
792 NOTREACHED(); 792 NOTREACHED();
793 } 793 }
794 } 794 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/certificate_selector.cc ('k') | components/components_chromium_strings.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698