Commit 0f33fff6 authored by Collin Baker's avatar Collin Baker Committed by Commit Bot

Make IPH promo bubbles blue with white text

This is to match the style in the latest UX mocks for desktop IPH.

Bug: 887991
Change-Id: I59326fe8012039ba765b2af5de9dd97dcd710bb3
Reviewed-on: https://chromium-review.googlesource.com/c/1345209Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Commit-Queue: Collin Baker <collinbaker@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611772}
parent f34e1902
......@@ -285,6 +285,10 @@ SkColor ThemeProperties::GetDefaultColor(int id, bool incognito) {
NOTREACHED();
return gfx::kPlaceholderColor;
#endif
case COLOR_FEATURE_PROMO_BUBBLE_TEXT:
return SK_ColorWHITE;
case COLOR_FEATURE_PROMO_BUBBLE_BACKGROUND:
return gfx::kGoogleBlue700;
case COLOR_FRAME_INCOGNITO:
case COLOR_FRAME_INCOGNITO_INACTIVE:
......
......@@ -159,6 +159,10 @@ class ThemeProperties {
#endif // OS_WIN
SHOULD_FILL_BACKGROUND_TAB_COLOR,
// Colors for in-product help promo bubbles.
COLOR_FEATURE_PROMO_BUBBLE_TEXT,
COLOR_FEATURE_PROMO_BUBBLE_BACKGROUND,
};
// Represents the lookup values for a theme property.
......
......@@ -7,8 +7,10 @@
#include <memory>
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/themes/theme_properties.h"
#include "components/variations/variations_associated_data.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/theme_provider.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/text_utils.h"
#include "ui/views/controls/label.h"
......@@ -60,6 +62,16 @@ FeaturePromoBubbleView::FeaturePromoBubbleView(
if (!anchor_view)
SetAnchorRect(anchor_rect);
// We get the theme provider from the anchor view since our widget hasn't been
// created yet.
const ui::ThemeProvider* theme_provider = anchor_view->GetThemeProvider();
DCHECK(theme_provider);
const SkColor background_color = theme_provider->GetColor(
ThemeProperties::COLOR_FEATURE_PROMO_BUBBLE_BACKGROUND);
const SkColor text_color = theme_provider->GetColor(
ThemeProperties::COLOR_FEATURE_PROMO_BUBBLE_TEXT);
auto box_layout = std::make_unique<views::BoxLayout>(
views::BoxLayout::kVertical, gfx::Insets(), 0);
box_layout->set_main_axis_alignment(
......@@ -68,11 +80,18 @@ FeaturePromoBubbleView::FeaturePromoBubbleView(
views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER);
SetLayoutManager(std::move(box_layout));
AddChildView(new views::Label(l10n_util::GetStringUTF16(string_specifier)));
auto* label = new views::Label(l10n_util::GetStringUTF16(string_specifier));
label->SetBackgroundColor(background_color);
label->SetEnabledColor(text_color);
AddChildView(label);
if (activation_action == ActivationAction::DO_NOT_ACTIVATE) {
set_can_activate(activation_action == ActivationAction::ACTIVATE);
set_shadow(views::BubbleBorder::BIG_SHADOW);
}
set_color(background_color);
views::Widget* widget = views::BubbleDialogDelegateView::CreateBubble(this);
widget->Show();
......
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