Chromium Code Reviews| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 #include "ui/base/l10n/l10n_util.h" | 44 #include "ui/base/l10n/l10n_util.h" |
| 45 #include "ui/base/models/simple_menu_model.h" | 45 #include "ui/base/models/simple_menu_model.h" |
| 46 #include "ui/base/resource/resource_bundle.h" | 46 #include "ui/base/resource/resource_bundle.h" |
| 47 #include "ui/gfx/canvas.h" | 47 #include "ui/gfx/canvas.h" |
| 48 #include "ui/gfx/font_list.h" | 48 #include "ui/gfx/font_list.h" |
| 49 #include "ui/gfx/geometry/insets.h" | 49 #include "ui/gfx/geometry/insets.h" |
| 50 #include "ui/gfx/image/image.h" | 50 #include "ui/gfx/image/image.h" |
| 51 #include "ui/resources/grit/ui_resources.h" | 51 #include "ui/resources/grit/ui_resources.h" |
| 52 #include "ui/views/bubble/bubble_frame_view.h" | 52 #include "ui/views/bubble/bubble_frame_view.h" |
| 53 #include "ui/views/controls/button/image_button.h" | 53 #include "ui/views/controls/button/image_button.h" |
| 54 #include "ui/views/controls/button/label_button.h" | 54 #include "ui/views/controls/button/md_text_button.h" |
| 55 #include "ui/views/controls/image_view.h" | 55 #include "ui/views/controls/image_view.h" |
| 56 #include "ui/views/controls/label.h" | 56 #include "ui/views/controls/label.h" |
| 57 #include "ui/views/controls/link.h" | 57 #include "ui/views/controls/link.h" |
| 58 #include "ui/views/controls/styled_label.h" | 58 #include "ui/views/controls/styled_label.h" |
| 59 #include "ui/views/layout/box_layout.h" | 59 #include "ui/views/layout/box_layout.h" |
| 60 #include "ui/views/layout/grid_layout.h" | 60 #include "ui/views/layout/grid_layout.h" |
| 61 #include "ui/views/layout/layout_manager.h" | 61 #include "ui/views/layout/layout_manager.h" |
| 62 #include "ui/views/view.h" | 62 #include "ui/views/view.h" |
| 63 #include "ui/views/widget/widget.h" | 63 #include "ui/views/widget/widget.h" |
| 64 #include "url/gurl.h" | 64 #include "url/gurl.h" |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 292 status_->AddStyleRange(details_range, link_style); | 292 status_->AddStyleRange(details_range, link_style); |
| 293 } else { | 293 } else { |
| 294 status_->SetText(security_summary_text); | 294 status_->SetText(security_summary_text); |
| 295 } | 295 } |
| 296 | 296 |
| 297 // Fit the styled label to occupy available width. | 297 // Fit the styled label to occupy available width. |
| 298 status_->SizeToFit(0); | 298 status_->SizeToFit(0); |
| 299 } | 299 } |
| 300 | 300 |
| 301 void PopupHeaderView::AddResetDecisionsButton() { | 301 void PopupHeaderView::AddResetDecisionsButton() { |
| 302 views::LabelButton* reset_decisions_button = new views::LabelButton( | 302 // TODO(estade): this looks pretty crazy as an MD button because the button |
|
msw
2016/05/12 19:17:04
nit: file a bug?
Evan Stade
2016/05/12 19:32:02
added link to crbug.com/512442
| |
| 303 button_listener_, | 303 // text is very long. |
| 304 l10n_util::GetStringUTF16( | 304 views::LabelButton* reset_decisions_button = |
| 305 IDS_PAGEINFO_RESET_INVALID_CERTIFICATE_DECISIONS_BUTTON)); | 305 views::MdTextButton::CreateSecondaryUiButton( |
| 306 button_listener_, | |
| 307 l10n_util::GetStringUTF16( | |
| 308 IDS_PAGEINFO_RESET_INVALID_CERTIFICATE_DECISIONS_BUTTON)); | |
| 306 reset_decisions_button->set_id(BUTTON_RESET_CERTIFICATE_DECISIONS); | 309 reset_decisions_button->set_id(BUTTON_RESET_CERTIFICATE_DECISIONS); |
| 307 reset_decisions_button->SetStyle(views::Button::STYLE_BUTTON); | |
| 308 | 310 |
| 309 reset_decisions_button_container_->AddChildView(reset_decisions_button); | 311 reset_decisions_button_container_->AddChildView(reset_decisions_button); |
| 310 | 312 |
| 311 // Now that it contains a button, the container needs padding at the top. | 313 // Now that it contains a button, the container needs padding at the top. |
| 312 reset_decisions_button_container_->SetBorder( | 314 reset_decisions_button_container_->SetBorder( |
| 313 views::Border::CreateEmptyBorder(8, 0, 0, 0)); | 315 views::Border::CreateEmptyBorder(8, 0, 0, 0)); |
| 314 | 316 |
| 315 InvalidateLayout(); | 317 InvalidateLayout(); |
| 316 } | 318 } |
| 317 | 319 |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 813 gfx::NativeWindow parent = | 815 gfx::NativeWindow parent = |
| 814 anchor_widget() ? anchor_widget()->GetNativeWindow() : nullptr; | 816 anchor_widget() ? anchor_widget()->GetNativeWindow() : nullptr; |
| 815 presenter_->RecordWebsiteSettingsAction( | 817 presenter_->RecordWebsiteSettingsAction( |
| 816 WebsiteSettings::WEBSITE_SETTINGS_CERTIFICATE_DIALOG_OPENED); | 818 WebsiteSettings::WEBSITE_SETTINGS_CERTIFICATE_DIALOG_OPENED); |
| 817 ShowCertificateViewerByID(web_contents_, parent, cert_id_); | 819 ShowCertificateViewerByID(web_contents_, parent, cert_id_); |
| 818 } else { | 820 } else { |
| 819 DevToolsWindow::OpenDevToolsWindow( | 821 DevToolsWindow::OpenDevToolsWindow( |
| 820 web_contents_, DevToolsToggleAction::ShowSecurityPanel()); | 822 web_contents_, DevToolsToggleAction::ShowSecurityPanel()); |
| 821 } | 823 } |
| 822 } | 824 } |
| OLD | NEW |