Commit 594f4118 authored by Charles Harrison's avatar Charles Harrison Committed by Commit Bot

Content Setting Bubbles: Make the "learn more" link a help image button

This aligns the look more with the future Harmony UI. Additionally,
this CL addds a .icon version of the "help-outline" svg image in
chrome/browser/resources/settings/icons.html

Bug: 736318
Change-Id: I41090a0ee5ed7e23490855213baf6b9d89b78629
Reviewed-on: https://chromium-review.googlesource.com/544199
Commit-Queue: Charlie Harrison <csharrison@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491191}
parent ab05cc0d
...@@ -1018,7 +1018,7 @@ const ContentTypeToNibPath kNibPaths[] = { ...@@ -1018,7 +1018,7 @@ const ContentTypeToNibPath kNibPaths[] = {
} }
- (IBAction)learnMoreLinkClicked:(id)sender { - (IBAction)learnMoreLinkClicked:(id)sender {
contentSettingBubbleModel_->OnLearnMoreLinkClicked(); contentSettingBubbleModel_->OnLearnMoreClicked();
} }
- (IBAction)manageBlocking:(id)sender { - (IBAction)manageBlocking:(id)sender {
......
...@@ -64,8 +64,9 @@ ...@@ -64,8 +64,9 @@
[messageLabel_ release]; [messageLabel_ release];
// Set up the "Learn more" link. // Set up the "Learn more" link.
NSString* linkText = base::SysUTF16ToNSString( // TODO(csharrison): Migrate this to use the help icon to align with
contentSettingBubbleModel_->bubble_content().learn_more_link); // Windows/Linux.
NSString* linkText = l10n_util::GetNSString(IDS_LEARN_MORE);
learnMoreLink_ = [[NSButton alloc] initWithFrame:NSMakeRect(18, 76, 282, 28)]; learnMoreLink_ = [[NSButton alloc] initWithFrame:NSMakeRect(18, 76, 282, 28)];
base::scoped_nsobject<HyperlinkButtonCell> cell( base::scoped_nsobject<HyperlinkButtonCell> cell(
[[HyperlinkButtonCell alloc] initTextCell:linkText]); [[HyperlinkButtonCell alloc] initTextCell:linkText]);
......
...@@ -443,7 +443,7 @@ class ContentSettingPluginBubbleModel : public ContentSettingSimpleBubbleModel { ...@@ -443,7 +443,7 @@ class ContentSettingPluginBubbleModel : public ContentSettingSimpleBubbleModel {
Profile* profile); Profile* profile);
private: private:
void OnLearnMoreLinkClicked() override; void OnLearnMoreClicked() override;
void OnCustomLinkClicked() override; void OnCustomLinkClicked() override;
void RunPluginsOnPage(); void RunPluginsOnPage();
...@@ -505,13 +505,13 @@ ContentSettingPluginBubbleModel::ContentSettingPluginBubbleModel( ...@@ -505,13 +505,13 @@ ContentSettingPluginBubbleModel::ContentSettingPluginBubbleModel(
} }
} }
set_learn_more_link(l10n_util::GetStringUTF16(IDS_LEARN_MORE)); set_show_learn_more(true);
content_settings::RecordPluginsAction( content_settings::RecordPluginsAction(
content_settings::PLUGINS_ACTION_DISPLAYED_BUBBLE); content_settings::PLUGINS_ACTION_DISPLAYED_BUBBLE);
} }
void ContentSettingPluginBubbleModel::OnLearnMoreLinkClicked() { void ContentSettingPluginBubbleModel::OnLearnMoreClicked() {
if (delegate()) if (delegate())
delegate()->ShowLearnMorePage(CONTENT_SETTINGS_TYPE_PLUGINS); delegate()->ShowLearnMorePage(CONTENT_SETTINGS_TYPE_PLUGINS);
...@@ -1240,7 +1240,7 @@ ContentSettingSubresourceFilterBubbleModel:: ...@@ -1240,7 +1240,7 @@ ContentSettingSubresourceFilterBubbleModel::
// TODO(csharrison): The learn more link UI layout is non ideal. Make it align // TODO(csharrison): The learn more link UI layout is non ideal. Make it align
// with the future Harmony UI version with a link icon in the bottom left of // with the future Harmony UI version with a link icon in the bottom left of
// the bubble. // the bubble.
set_learn_more_link(l10n_util::GetStringUTF16(IDS_LEARN_MORE)); set_show_learn_more(true);
ChromeSubresourceFilterClient::LogAction(kActionDetailsShown); ChromeSubresourceFilterClient::LogAction(kActionDetailsShown);
} }
...@@ -1273,7 +1273,7 @@ void ContentSettingSubresourceFilterBubbleModel::OnManageCheckboxChecked( ...@@ -1273,7 +1273,7 @@ void ContentSettingSubresourceFilterBubbleModel::OnManageCheckboxChecked(
is_checked_ = is_checked; is_checked_ = is_checked;
} }
void ContentSettingSubresourceFilterBubbleModel::OnLearnMoreLinkClicked() { void ContentSettingSubresourceFilterBubbleModel::OnLearnMoreClicked() {
DCHECK(delegate()); DCHECK(delegate());
ChromeSubresourceFilterClient::LogAction(kActionClickedLearnMore); ChromeSubresourceFilterClient::LogAction(kActionClickedLearnMore);
delegate()->ShowLearnMorePage(CONTENT_SETTINGS_TYPE_ADS); delegate()->ShowLearnMorePage(CONTENT_SETTINGS_TYPE_ADS);
......
...@@ -126,7 +126,7 @@ class ContentSettingBubbleModel : public content::NotificationObserver { ...@@ -126,7 +126,7 @@ class ContentSettingBubbleModel : public content::NotificationObserver {
base::string16 manage_text; base::string16 manage_text;
bool show_manage_text_as_checkbox = false; bool show_manage_text_as_checkbox = false;
MediaMenuMap media_menus; MediaMenuMap media_menus;
base::string16 learn_more_link; bool show_learn_more = false;
base::string16 done_button_text; base::string16 done_button_text;
private: private:
...@@ -157,7 +157,7 @@ class ContentSettingBubbleModel : public content::NotificationObserver { ...@@ -157,7 +157,7 @@ class ContentSettingBubbleModel : public content::NotificationObserver {
virtual void OnCustomLinkClicked() {} virtual void OnCustomLinkClicked() {}
virtual void OnManageLinkClicked() {} virtual void OnManageLinkClicked() {}
virtual void OnManageCheckboxChecked(bool is_checked) {} virtual void OnManageCheckboxChecked(bool is_checked) {}
virtual void OnLearnMoreLinkClicked() {} virtual void OnLearnMoreClicked() {}
virtual void OnMediaMenuClicked(content::MediaStreamType type, virtual void OnMediaMenuClicked(content::MediaStreamType type,
const std::string& selected_device_id) {} const std::string& selected_device_id) {}
...@@ -235,8 +235,8 @@ class ContentSettingBubbleModel : public content::NotificationObserver { ...@@ -235,8 +235,8 @@ class ContentSettingBubbleModel : public content::NotificationObserver {
void set_selected_device(const content::MediaStreamDevice& device) { void set_selected_device(const content::MediaStreamDevice& device) {
bubble_content_.media_menus[device.type].selected_device = device; bubble_content_.media_menus[device.type].selected_device = device;
} }
void set_learn_more_link(const base::string16& link) { void set_show_learn_more(bool show_learn_more) {
bubble_content_.learn_more_link = link; bubble_content_.show_learn_more = show_learn_more;
} }
void set_done_button_text(const base::string16& done_button_text) { void set_done_button_text(const base::string16& done_button_text) {
bubble_content_.done_button_text = done_button_text; bubble_content_.done_button_text = done_button_text;
...@@ -333,7 +333,7 @@ class ContentSettingSubresourceFilterBubbleModel ...@@ -333,7 +333,7 @@ class ContentSettingSubresourceFilterBubbleModel
void OnManageCheckboxChecked(bool is_checked) override; void OnManageCheckboxChecked(bool is_checked) override;
ContentSettingSubresourceFilterBubbleModel* AsSubresourceFilterBubbleModel() ContentSettingSubresourceFilterBubbleModel* AsSubresourceFilterBubbleModel()
override; override;
void OnLearnMoreLinkClicked() override; void OnLearnMoreClicked() override;
void OnDoneClicked() override; void OnDoneClicked() override;
bool is_checked_ = false; bool is_checked_ = false;
......
...@@ -739,7 +739,7 @@ TEST_F(ContentSettingBubbleModelTest, Plugins) { ...@@ -739,7 +739,7 @@ TEST_F(ContentSettingBubbleModelTest, Plugins) {
EXPECT_FALSE(bubble_content.custom_link.empty()); EXPECT_FALSE(bubble_content.custom_link.empty());
EXPECT_TRUE(bubble_content.custom_link_enabled); EXPECT_TRUE(bubble_content.custom_link_enabled);
EXPECT_FALSE(bubble_content.manage_text.empty()); EXPECT_FALSE(bubble_content.manage_text.empty());
EXPECT_FALSE(bubble_content.learn_more_link.empty()); EXPECT_TRUE(bubble_content.show_learn_more);
} }
TEST_F(ContentSettingBubbleModelTest, PepperBroker) { TEST_F(ContentSettingBubbleModelTest, PepperBroker) {
...@@ -943,8 +943,7 @@ TEST_F(ContentSettingBubbleModelTest, SubresourceFilter) { ...@@ -943,8 +943,7 @@ TEST_F(ContentSettingBubbleModelTest, SubresourceFilter) {
l10n_util::GetStringUTF16(IDS_BLOCKED_ADS_PROMPT_EXPLANATION)); l10n_util::GetStringUTF16(IDS_BLOCKED_ADS_PROMPT_EXPLANATION));
EXPECT_EQ(0U, bubble_content.radio_group.radio_items.size()); EXPECT_EQ(0U, bubble_content.radio_group.radio_items.size());
EXPECT_EQ(0, bubble_content.radio_group.default_item); EXPECT_EQ(0, bubble_content.radio_group.default_item);
EXPECT_EQ(l10n_util::GetStringUTF16(IDS_LEARN_MORE), EXPECT_TRUE(bubble_content.show_learn_more);
bubble_content.learn_more_link);
EXPECT_TRUE(bubble_content.custom_link.empty()); EXPECT_TRUE(bubble_content.custom_link.empty());
EXPECT_FALSE(bubble_content.custom_link_enabled); EXPECT_FALSE(bubble_content.custom_link_enabled);
EXPECT_EQ(bubble_content.manage_text, EXPECT_EQ(bubble_content.manage_text,
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
#include "components/vector_icons/vector_icons.h"
#include "content/public/browser/navigation_handle.h" #include "content/public/browser/navigation_handle.h"
#include "content/public/browser/plugin_service.h" #include "content/public/browser/plugin_service.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
...@@ -32,8 +33,14 @@ ...@@ -32,8 +33,14 @@
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/simple_menu_model.h" #include "ui/base/models/simple_menu_model.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/font_list.h" #include "ui/gfx/font_list.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/gfx/text_utils.h" #include "ui/gfx/text_utils.h"
#include "ui/native_theme/native_theme.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/button/image_button_factory.h"
#include "ui/views/controls/button/label_button_border.h" #include "ui/views/controls/button/label_button_border.h"
#include "ui/views/controls/button/menu_button.h" #include "ui/views/controls/button/menu_button.h"
#include "ui/views/controls/button/radio_button.h" #include "ui/views/controls/button/radio_button.h"
...@@ -172,7 +179,7 @@ ContentSettingBubbleContents::ContentSettingBubbleContents( ...@@ -172,7 +179,7 @@ ContentSettingBubbleContents::ContentSettingBubbleContents(
custom_link_(nullptr), custom_link_(nullptr),
manage_link_(nullptr), manage_link_(nullptr),
manage_checkbox_(nullptr), manage_checkbox_(nullptr),
learn_more_link_(nullptr) { learn_more_button_(nullptr) {
// Compensate for built-in vertical padding in the anchor view's image. // Compensate for built-in vertical padding in the anchor view's image.
set_anchor_view_insets(gfx::Insets( set_anchor_view_insets(gfx::Insets(
GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0)); GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0));
...@@ -202,6 +209,13 @@ gfx::Size ContentSettingBubbleContents::CalculatePreferredSize() const { ...@@ -202,6 +209,13 @@ gfx::Size ContentSettingBubbleContents::CalculatePreferredSize() const {
return preferred_size; return preferred_size;
} }
void ContentSettingBubbleContents::OnNativeThemeChanged(
const ui::NativeTheme* theme) {
views::BubbleDialogDelegateView::OnNativeThemeChanged(theme);
if (learn_more_button_)
StyleLearnMoreButton(theme);
}
void ContentSettingBubbleContents::Init() { void ContentSettingBubbleContents::Init() {
using views::GridLayout; using views::GridLayout;
...@@ -253,14 +267,6 @@ void ContentSettingBubbleContents::Init() { ...@@ -253,14 +267,6 @@ void ContentSettingBubbleContents::Init() {
bubble_content_empty = false; bubble_content_empty = false;
} }
if (!bubble_content.learn_more_link.empty()) {
learn_more_link_ = new views::Link(bubble_content.learn_more_link);
learn_more_link_->set_listener(this);
learn_more_link_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
layout->AddView(learn_more_link_);
bubble_content_empty = false;
}
// Layout for the item list (blocked plugins and popups). // Layout for the item list (blocked plugins and popups).
if (!bubble_content.list_items.empty()) { if (!bubble_content.list_items.empty()) {
const int kItemListColumnSetId = 2; const int kItemListColumnSetId = 2;
...@@ -297,10 +303,10 @@ void ContentSettingBubbleContents::Init() { ...@@ -297,10 +303,10 @@ void ContentSettingBubbleContents::Init() {
} }
} }
const int indented_kSingleColumnSetId = 3; const int kIndentedSingleColumnSetId = 3;
// Insert a column set with greater indent. // Insert a column set with greater indent.
views::ColumnSet* indented_single_column_set = views::ColumnSet* indented_single_column_set =
layout->AddColumnSet(indented_kSingleColumnSetId); layout->AddColumnSet(kIndentedSingleColumnSetId);
indented_single_column_set->AddPaddingColumn( indented_single_column_set->AddPaddingColumn(
0, provider->GetDistanceMetric(DISTANCE_SUBSECTION_HORIZONTAL_INDENT)); 0, provider->GetDistanceMetric(DISTANCE_SUBSECTION_HORIZONTAL_INDENT));
indented_single_column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, indented_single_column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL,
...@@ -318,7 +324,7 @@ void ContentSettingBubbleContents::Init() { ...@@ -318,7 +324,7 @@ void ContentSettingBubbleContents::Init() {
radio->SetEnabled(bubble_content.radio_group_enabled); radio->SetEnabled(bubble_content.radio_group_enabled);
radio->set_listener(this); radio->set_listener(this);
radio_group_.push_back(radio); radio_group_.push_back(radio);
layout->StartRow(0, indented_kSingleColumnSetId); layout->StartRow(0, kIndentedSingleColumnSetId);
layout->AddView(radio); layout->AddView(radio);
bubble_content_empty = false; bubble_content_empty = false;
} }
...@@ -380,7 +386,7 @@ void ContentSettingBubbleContents::Init() { ...@@ -380,7 +386,7 @@ void ContentSettingBubbleContents::Init() {
layout->AddView(section_title, 1, 1, GridLayout::FILL, GridLayout::LEADING); layout->AddView(section_title, 1, 1, GridLayout::FILL, GridLayout::LEADING);
for (std::set<std::string>::const_iterator j = i->hosts.begin(); for (std::set<std::string>::const_iterator j = i->hosts.begin();
j != i->hosts.end(); ++j) { j != i->hosts.end(); ++j) {
layout->StartRow(0, indented_kSingleColumnSetId); layout->StartRow(0, kIndentedSingleColumnSetId);
// TODO(tapted): Verify this when we have a mock. http://crbug.com/700196. // TODO(tapted): Verify this when we have a mock. http://crbug.com/700196.
layout->AddView(new views::Label( layout->AddView(new views::Label(
base::UTF8ToUTF16(*j), CONTEXT_BODY_TEXT_LARGE, STYLE_EMPHASIZED)); base::UTF8ToUTF16(*j), CONTEXT_BODY_TEXT_LARGE, STYLE_EMPHASIZED));
...@@ -399,12 +405,17 @@ void ContentSettingBubbleContents::Init() { ...@@ -399,12 +405,17 @@ void ContentSettingBubbleContents::Init() {
bubble_content_empty = false; bubble_content_empty = false;
} }
layout->AddPaddingRow(0, related_control_vertical_spacing);
if (bubble_content.show_manage_text_as_checkbox) { if (bubble_content.show_manage_text_as_checkbox) {
layout->StartRow(0, kIndentedSingleColumnSetId);
manage_checkbox_ = new views::Checkbox(bubble_content.manage_text); manage_checkbox_ = new views::Checkbox(bubble_content.manage_text);
manage_checkbox_->set_listener(this); manage_checkbox_->set_listener(this);
layout->AddPaddingRow(0, related_control_vertical_spacing);
layout->StartRow(0, indented_kSingleColumnSetId);
layout->AddView(manage_checkbox_); layout->AddView(manage_checkbox_);
} else {
layout->StartRow(0, kSingleColumnSetId);
manage_link_ = new views::Link(bubble_content.manage_text);
manage_link_->set_listener(this);
layout->AddView(manage_link_);
} }
if (!bubble_content_empty) { if (!bubble_content_empty) {
...@@ -419,15 +430,15 @@ void ContentSettingBubbleContents::Init() { ...@@ -419,15 +430,15 @@ void ContentSettingBubbleContents::Init() {
} }
views::View* ContentSettingBubbleContents::CreateExtraView() { views::View* ContentSettingBubbleContents::CreateExtraView() {
const ContentSettingBubbleModel::BubbleContent& bubble_content = // Optionally add a help icon if the view wants to link to a help page.
content_setting_bubble_model_->bubble_content(); if (!content_setting_bubble_model_->bubble_content().show_learn_more)
// Added as part of the primary view.
if (bubble_content.show_manage_text_as_checkbox)
return nullptr; return nullptr;
manage_link_ = new views::Link(bubble_content.manage_text); learn_more_button_ = views::CreateVectorImageButton(this);
manage_link_->set_listener(this); learn_more_button_->SetFocusForPlatform();
return manage_link_; learn_more_button_->SetTooltipText(l10n_util::GetStringUTF16(IDS_LEARN_MORE));
StyleLearnMoreButton(GetNativeTheme());
return learn_more_button_;
} }
bool ContentSettingBubbleContents::Accept() { bool ContentSettingBubbleContents::Accept() {
...@@ -452,6 +463,18 @@ base::string16 ContentSettingBubbleContents::GetDialogButtonLabel( ...@@ -452,6 +463,18 @@ base::string16 ContentSettingBubbleContents::GetDialogButtonLabel(
return l10n_util::GetStringUTF16(IDS_DONE); return l10n_util::GetStringUTF16(IDS_DONE);
} }
void ContentSettingBubbleContents::StyleLearnMoreButton(
const ui::NativeTheme* theme) {
DCHECK(learn_more_button_);
SkColor text_color =
theme->GetSystemColor(ui::NativeTheme::kColorId_LabelEnabledColor);
learn_more_button_->SetImage(
views::CustomButton::STATE_NORMAL,
gfx::CreateVectorIcon(vector_icons::kHelpOutlineIcon, 16,
color_utils::DeriveDefaultIconColor(text_color)));
learn_more_button_->set_ink_drop_base_color(text_color);
}
void ContentSettingBubbleContents::DidFinishNavigation( void ContentSettingBubbleContents::DidFinishNavigation(
content::NavigationHandle* navigation_handle) { content::NavigationHandle* navigation_handle) {
if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted()) if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted())
...@@ -464,13 +487,16 @@ void ContentSettingBubbleContents::DidFinishNavigation( ...@@ -464,13 +487,16 @@ void ContentSettingBubbleContents::DidFinishNavigation(
void ContentSettingBubbleContents::ButtonPressed(views::Button* sender, void ContentSettingBubbleContents::ButtonPressed(views::Button* sender,
const ui::Event& event) { const ui::Event& event) {
if (manage_checkbox_ == sender) { if (sender == manage_checkbox_) {
content_setting_bubble_model_->OnManageCheckboxChecked( content_setting_bubble_model_->OnManageCheckboxChecked(
manage_checkbox_->checked()); manage_checkbox_->checked());
// Toggling the check state may change the dialog button text. // Toggling the check state may change the dialog button text.
GetDialogClientView()->UpdateDialogButtons(); GetDialogClientView()->UpdateDialogButtons();
GetDialogClientView()->Layout(); GetDialogClientView()->Layout();
} else if (sender == learn_more_button_) {
content_setting_bubble_model_->OnLearnMoreClicked();
GetWidget()->Close();
} else { } else {
RadioGroup::const_iterator i( RadioGroup::const_iterator i(
std::find(radio_group_.begin(), radio_group_.end(), sender)); std::find(radio_group_.begin(), radio_group_.end(), sender));
...@@ -481,11 +507,6 @@ void ContentSettingBubbleContents::ButtonPressed(views::Button* sender, ...@@ -481,11 +507,6 @@ void ContentSettingBubbleContents::ButtonPressed(views::Button* sender,
void ContentSettingBubbleContents::LinkClicked(views::Link* source, void ContentSettingBubbleContents::LinkClicked(views::Link* source,
int event_flags) { int event_flags) {
if (source == learn_more_link_) {
content_setting_bubble_model_->OnLearnMoreLinkClicked();
GetWidget()->Close();
return;
}
if (source == custom_link_) { if (source == custom_link_) {
content_setting_bubble_model_->OnCustomLinkClicked(); content_setting_bubble_model_->OnCustomLinkClicked();
GetWidget()->Close(); GetWidget()->Close();
......
...@@ -28,6 +28,7 @@ class ContentSettingBubbleViewsBridge; ...@@ -28,6 +28,7 @@ class ContentSettingBubbleViewsBridge;
} }
namespace views { namespace views {
class ImageButton;
class RadioButton; class RadioButton;
class LabelButton; class LabelButton;
} }
...@@ -54,6 +55,7 @@ class ContentSettingBubbleContents : public content::WebContentsObserver, ...@@ -54,6 +55,7 @@ class ContentSettingBubbleContents : public content::WebContentsObserver,
views::BubbleBorder::Arrow arrow); views::BubbleBorder::Arrow arrow);
~ContentSettingBubbleContents() override; ~ContentSettingBubbleContents() override;
// views::BubbleDialogDelegateView:
gfx::Size CalculatePreferredSize() const override; gfx::Size CalculatePreferredSize() const override;
protected: protected:
...@@ -64,6 +66,7 @@ class ContentSettingBubbleContents : public content::WebContentsObserver, ...@@ -64,6 +66,7 @@ class ContentSettingBubbleContents : public content::WebContentsObserver,
bool Close() override; bool Close() override;
int GetDialogButtons() const override; int GetDialogButtons() const override;
base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
private: private:
// A combobox model that builds the contents of the media capture devices menu // A combobox model that builds the contents of the media capture devices menu
...@@ -94,6 +97,9 @@ class ContentSettingBubbleContents : public content::WebContentsObserver, ...@@ -94,6 +97,9 @@ class ContentSettingBubbleContents : public content::WebContentsObserver,
typedef std::map<views::Link*, int> ListItemLinks; typedef std::map<views::Link*, int> ListItemLinks;
// Applies the colors appropriate for |theme| to the learn more button.
void StyleLearnMoreButton(const ui::NativeTheme* theme);
// content::WebContentsObserver: // content::WebContentsObserver:
void DidFinishNavigation( void DidFinishNavigation(
content::NavigationHandle* navigation_handle) override; content::NavigationHandle* navigation_handle) override;
...@@ -119,7 +125,7 @@ class ContentSettingBubbleContents : public content::WebContentsObserver, ...@@ -119,7 +125,7 @@ class ContentSettingBubbleContents : public content::WebContentsObserver,
views::Link* manage_link_; views::Link* manage_link_;
views::LabelButton* manage_button_; views::LabelButton* manage_button_;
views::Checkbox* manage_checkbox_; views::Checkbox* manage_checkbox_;
views::Link* learn_more_link_; views::ImageButton* learn_more_button_;
// Combobox models the bubble owns. // Combobox models the bubble owns.
std::list<MediaComboboxModel> combobox_models_; std::list<MediaComboboxModel> combobox_models_;
......
...@@ -19,6 +19,7 @@ aggregate_vector_icons("components_vector_icons") { ...@@ -19,6 +19,7 @@ aggregate_vector_icons("components_vector_icons") {
"error_circle.icon", "error_circle.icon",
"forward_arrow.1x.icon", "forward_arrow.1x.icon",
"forward_arrow.icon", "forward_arrow.icon",
"help_outline.icon",
"info_outline.icon", "info_outline.icon",
"location_on.icon", "location_on.icon",
"lock.icon", "lock.icon",
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 24,
MOVE_TO, 11, 18,
R_H_LINE_TO, 2,
R_V_LINE_TO, -2,
R_H_LINE_TO, -2,
R_V_LINE_TO, 2,
CLOSE,
R_MOVE_TO, 1, -16,
CUBIC_TO, 6.48f, 2, 2, 6.48f, 2, 12,
R_CUBIC_TO, 0, 5.52f, 4.48f, 10, 10, 10,
R_CUBIC_TO, 5.52f, 0, 10, -4.48f, 10, -10,
CUBIC_TO_SHORTHAND, 17.52f, 2, 12, 2,
CLOSE,
R_MOVE_TO, 0, 18,
R_CUBIC_TO, -4.41f, 0, -8, -3.59f, -8, -8,
R_CUBIC_TO, 0, -4.41f, 3.59f, -8, 8, -8,
R_CUBIC_TO, 4.41f, 0, 8, 3.59f, 8, 8,
R_CUBIC_TO, 0, 4.41f, -3.59f, 8, -8, 8,
CLOSE,
R_MOVE_TO, 0, -14,
R_CUBIC_TO, -2.21f, 0, -4, 1.79f, -4, 4,
R_H_LINE_TO, 2,
R_CUBIC_TO, 0, -1.1f, 0.9f, -2, 2, -2,
R_CUBIC_TO, 1.1f, 0, 2, 0.9f, 2, 2,
R_CUBIC_TO, 0, 2, -3, 1.75f, -3, 5,
R_H_LINE_TO, 2,
R_CUBIC_TO, 0, -2.25f, 3, -2.5f, 3, -5,
R_CUBIC_TO, 0, -2.21f, -1.79f, -4, -4, -4,
CLOSE,
END
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment