| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |