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

Side by Side Diff: chrome/browser/ui/views/website_settings/website_settings_popup_view.cc

Issue 2023453002: MD links - underline to indicate focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix website settings Created 4 years, 6 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
« no previous file with comments | « no previous file | ui/views/controls/label.cc » ('j') | 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) 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/website_settings/website_settings_popup_view.h " 5 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h "
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 24 matching lines...) Expand all
35 #include "components/prefs/pref_service.h" 35 #include "components/prefs/pref_service.h"
36 #include "content/public/browser/browser_thread.h" 36 #include "content/public/browser/browser_thread.h"
37 #include "content/public/browser/cert_store.h" 37 #include "content/public/browser/cert_store.h"
38 #include "content/public/browser/user_metrics.h" 38 #include "content/public/browser/user_metrics.h"
39 #include "extensions/common/constants.h" 39 #include "extensions/common/constants.h"
40 #include "grit/components_chromium_strings.h" 40 #include "grit/components_chromium_strings.h"
41 #include "grit/components_google_chrome_strings.h" 41 #include "grit/components_google_chrome_strings.h"
42 #include "grit/components_strings.h" 42 #include "grit/components_strings.h"
43 #include "grit/theme_resources.h" 43 #include "grit/theme_resources.h"
44 #include "ui/base/l10n/l10n_util.h" 44 #include "ui/base/l10n/l10n_util.h"
45 #include "ui/base/material_design/material_design_controller.h"
45 #include "ui/base/models/simple_menu_model.h" 46 #include "ui/base/models/simple_menu_model.h"
46 #include "ui/base/resource/resource_bundle.h" 47 #include "ui/base/resource/resource_bundle.h"
47 #include "ui/gfx/canvas.h" 48 #include "ui/gfx/canvas.h"
48 #include "ui/gfx/font_list.h" 49 #include "ui/gfx/font_list.h"
49 #include "ui/gfx/geometry/insets.h" 50 #include "ui/gfx/geometry/insets.h"
50 #include "ui/gfx/image/image.h" 51 #include "ui/gfx/image/image.h"
51 #include "ui/resources/grit/ui_resources.h" 52 #include "ui/resources/grit/ui_resources.h"
52 #include "ui/views/bubble/bubble_frame_view.h" 53 #include "ui/views/bubble/bubble_frame_view.h"
53 #include "ui/views/controls/button/image_button.h" 54 #include "ui/views/controls/button/image_button.h"
54 #include "ui/views/controls/button/md_text_button.h" 55 #include "ui/views/controls/button/md_text_button.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 280
280 std::vector<size_t> offsets; 281 std::vector<size_t> offsets;
281 282
282 base::string16 text = base::ReplaceStringPlaceholders( 283 base::string16 text = base::ReplaceStringPlaceholders(
283 base::ASCIIToUTF16("$1 $2"), subst, &offsets); 284 base::ASCIIToUTF16("$1 $2"), subst, &offsets);
284 status_->SetText(text); 285 status_->SetText(text);
285 gfx::Range details_range(offsets[1], text.length()); 286 gfx::Range details_range(offsets[1], text.length());
286 287
287 views::StyledLabel::RangeStyleInfo link_style = 288 views::StyledLabel::RangeStyleInfo link_style =
288 views::StyledLabel::RangeStyleInfo::CreateForLink(); 289 views::StyledLabel::RangeStyleInfo::CreateForLink();
289 link_style.font_style |= gfx::Font::FontStyle::UNDERLINE; 290 if (!ui::MaterialDesignController::IsSecondaryUiMaterial())
291 link_style.font_style |= gfx::Font::FontStyle::UNDERLINE;
290 link_style.disable_line_wrapping = false; 292 link_style.disable_line_wrapping = false;
291 293
292 status_->AddStyleRange(details_range, link_style); 294 status_->AddStyleRange(details_range, link_style);
293 } else { 295 } else {
294 status_->SetText(security_summary_text); 296 status_->SetText(security_summary_text);
295 } 297 }
296 298
297 // Fit the styled label to occupy available width. 299 // Fit the styled label to occupy available width.
298 status_->SizeToFit(0); 300 status_->SizeToFit(0);
299 } 301 }
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 gfx::NativeWindow parent = 817 gfx::NativeWindow parent =
816 anchor_widget() ? anchor_widget()->GetNativeWindow() : nullptr; 818 anchor_widget() ? anchor_widget()->GetNativeWindow() : nullptr;
817 presenter_->RecordWebsiteSettingsAction( 819 presenter_->RecordWebsiteSettingsAction(
818 WebsiteSettings::WEBSITE_SETTINGS_CERTIFICATE_DIALOG_OPENED); 820 WebsiteSettings::WEBSITE_SETTINGS_CERTIFICATE_DIALOG_OPENED);
819 ShowCertificateViewerByID(web_contents_, parent, cert_id_); 821 ShowCertificateViewerByID(web_contents_, parent, cert_id_);
820 } else { 822 } else {
821 DevToolsWindow::OpenDevToolsWindow( 823 DevToolsWindow::OpenDevToolsWindow(
822 web_contents_, DevToolsToggleAction::ShowSecurityPanel()); 824 web_contents_, DevToolsToggleAction::ShowSecurityPanel());
823 } 825 }
824 } 826 }
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698