Commit 158e82a8 authored by Daniel Murphy's avatar Daniel Murphy Committed by Commit Bot

WebApp omnibox install icon experiment.

This change adds 2 new install icons, and creates a configurable feature
that will change the current icon to one of the new ones.

Before:
https://drive.google.com/file/d/1kjTrjTw1aPIBnEbZ018CEv3v9G25Q9Ve/view
Download style:
https://drive.google.com/file/d/1H6-GojGKMigLtSMBnqoJ3-H3SJYX5ZL9/view
Device style:
https://drive.google.com/file/d/1Cn1r6FCt4AxRPgMp0RGLM8P7w0fbTZJc/view
Reference images:
https://drive.google.com/corp/drive/folders/1m4CGxZJNP6PkQ6u7QHGPYuO5vy59fAlm

Doc:
https://docs.google.com/document/d/1D6vQpZR8X5l4rMCs9ErUvgxWNIPRK3iv4hGvy5qXSDo/edit#

Bug: 1117260
Change-Id: Id4d0ca6e67ce13093fe4ed6344424810e6665f30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2401329Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805968}
parent 7f1db885
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include "chrome/browser/ui/views/page_action/pwa_install_view.h" #include "chrome/browser/ui/views/page_action/pwa_install_view.h"
#include "base/bind_helpers.h" #include "base/bind_helpers.h"
#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
#include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics.h"
#include "chrome/app/chrome_command_ids.h" #include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/banners/app_banner_manager.h" #include "chrome/browser/banners/app_banner_manager.h"
...@@ -16,6 +18,23 @@ ...@@ -16,6 +18,23 @@
#include "components/omnibox/browser/vector_icons.h" #include "components/omnibox/browser/vector_icons.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
namespace {
const base::Feature kInstallIconExperiment{"InstallIconExperiment",
base::FEATURE_DISABLED_BY_DEFAULT};
enum class ExperimentIcon { kDownloadToDevice, kDownload };
constexpr base::FeatureParam<ExperimentIcon>::Option kIconParamOptions[] = {
{ExperimentIcon::kDownloadToDevice, "downloadToDevice"},
{ExperimentIcon::kDownload, "download"}};
constexpr base::FeatureParam<ExperimentIcon> kInstallIconParam{
&kInstallIconExperiment, "shape", ExperimentIcon::kDownloadToDevice,
&kIconParamOptions};
} // namespace
PwaInstallView::PwaInstallView( PwaInstallView::PwaInstallView(
CommandUpdater* command_updater, CommandUpdater* command_updater,
IconLabelBubbleView::Delegate* icon_label_bubble_delegate, IconLabelBubbleView::Delegate* icon_label_bubble_delegate,
...@@ -69,6 +88,15 @@ views::BubbleDialogDelegate* PwaInstallView::GetBubble() const { ...@@ -69,6 +88,15 @@ views::BubbleDialogDelegate* PwaInstallView::GetBubble() const {
} }
const gfx::VectorIcon& PwaInstallView::GetVectorIcon() const { const gfx::VectorIcon& PwaInstallView::GetVectorIcon() const {
if (base::FeatureList::IsEnabled(kInstallIconExperiment)) {
ExperimentIcon icon = kInstallIconParam.Get();
switch (icon) {
case ExperimentIcon::kDownloadToDevice:
return omnibox::kInstallDesktopIcon;
case ExperimentIcon::kDownload:
return omnibox::kInstallDownloadIcon;
}
}
return omnibox::kPlusIcon; return omnibox::kPlusIcon;
} }
......
...@@ -50,6 +50,8 @@ aggregate_vector_icons("omnibox_vector_icons") { ...@@ -50,6 +50,8 @@ aggregate_vector_icons("omnibox_vector_icons") {
"http.icon", "http.icon",
"https_valid.icon", "https_valid.icon",
"https_valid_in_chip.icon", "https_valid_in_chip.icon",
"install_desktop.icon",
"install_download.icon",
"keyword_search.icon", "keyword_search.icon",
"not_secure_warning.icon", "not_secure_warning.icon",
"offline_pin.icon", "offline_pin.icon",
......
// Copyright 2020 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, 16,
MOVE_TO, 8, 2,
R_V_LINE_TO, 1.33f,
R_LINE_TO, -4.8f, 0,
R_V_LINE_TO, 7.33f,
R_H_LINE_TO, 9.6f,
V_LINE_TO, 9.26f,
H_LINE_TO, 14,
R_V_LINE_TO, 1.41f,
R_CUBIC_TO, 0, 0.69f, -0.47f, 1.26f, -1.08f, 1.33f,
LINE_TO, 12.8f, 12,
H_LINE_TO, 11,
R_LINE_TO, 0.6f, 0.67f,
V_LINE_TO, 14,
H_LINE_TO, 4.4f,
R_V_LINE_TO, -1.33f,
LINE_TO, 5, 12,
H_LINE_TO, 3.2f,
R_CUBIC_TO, -0.62f, 0, -1.13f, -0.53f, -1.19f, -1.2f,
LINE_TO, 2, 10.67f,
V_LINE_TO, 3.33f,
R_CUBIC_TO, 0, -0.69f, 0.47f, -1.26f, 1.08f, -1.33f,
LINE_TO, 3.2f, 2,
H_LINE_TO, 8,
CLOSE,
MOVE_TO, 11.6f, 2,
R_V_LINE_TO, 4.77f,
R_LINE_TO, 1.55f, -1.5f,
R_LINE_TO, 0.85f, 0.82f,
LINE_TO, 11, 9,
LINE_TO, 8, 6.08f,
R_LINE_TO, 0.85f, -0.82f,
R_LINE_TO, 1.55f, 1.51f,
V_LINE_TO, 2,
CLOSE
// Copyright 2020 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, 16,
MOVE_TO, 3.52f, 10.57f,
R_V_LINE_TO, 1.9f,
R_H_LINE_TO, 8.95f,
R_V_LINE_TO, -1.9f,
H_LINE_TO, 14,
R_V_LINE_TO, 2.66f,
R_CUBIC_TO, 0, 0.42f, -0.34f, 0.76f, -0.76f, 0.76f,
H_LINE_TO, 2.76f,
CUBIC_TO, 2.34f, 14, 2, 13.66f, 2, 13.23f,
R_V_LINE_TO, -2.66f,
R_H_LINE_TO, 1.52f,
CLOSE,
MOVE_TO, 8.86f, 2,
LINE_TO, 8.86f, 8.07f,
R_LINE_TO, 2.01f, -1.88f,
LINE_TO, 12, 7.25f,
R_LINE_TO, -0.01f, 0.01f,
R_LINE_TO, 0.3f, 0.27f,
R_LINE_TO, -4.29f, 3.89f,
R_LINE_TO, -4.29f, -3.89f,
LINE_TO, 4.01f, 7.26f,
LINE_TO, 4, 7.25f,
R_LINE_TO, 1.13f, -1.06f,
LINE_TO, 7.14f, 8.07f,
LINE_TO, 7.14f, 2,
CLOSE
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