Commit 8f232819 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Update ethernet icon and update network icon size

This CL updates ethernet icon in UnifiedSystemTray to the one specified
in spec. Also, size of an icon in Unified's default view is 24.

TEST=manual
BUG=842079

Change-Id: I988d9449855201ba9f1ec096c11aacabc12d8dc4
Reviewed-on: https://chromium-review.googlesource.com/1123959Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580051}
parent d79a374a
......@@ -14,6 +14,7 @@
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/strings/utf_string_conversions.h"
#include "components/vector_icons/vector_icons.h"
#include "chromeos/network/device_state.h"
#include "chromeos/network/network_connection_handler.h"
#include "chromeos/network/network_state.h"
......@@ -226,8 +227,14 @@ ImageType ImageTypeForNetwork(const NetworkState* network, IconType icon_type) {
}
gfx::Size GetSizeForIconType(IconType icon_type) {
int side = icon_type == ICON_TYPE_TRAY ? kTrayIconSize : kMenuIconSize;
return gfx::Size(side, side);
int size = kMenuIconSize;
if (icon_type == ICON_TYPE_TRAY) {
size = kTrayIconSize;
} else if (features::IsSystemTrayUnifiedEnabled() &&
icon_type == ICON_TYPE_DEFAULT_VIEW) {
size = kUnifiedFeaturePodVectorIconSize;
}
return gfx::Size(size, size);
}
gfx::ImageSkia GetImageForIndex(ImageType image_type,
......@@ -335,7 +342,9 @@ gfx::ImageSkia GetIcon(const NetworkState* network,
IconType icon_type,
int strength_index) {
if (network->Matches(NetworkTypePattern::Ethernet())) {
return gfx::CreateVectorIcon(kNetworkEthernetIcon,
return gfx::CreateVectorIcon(features::IsSystemTrayUnifiedEnabled()
? vector_icons::kEthernetIcon
: kNetworkEthernetIcon,
GetDefaultColorForIconType(icon_type));
}
if (network->Matches(NetworkTypePattern::Wireless())) {
......
......@@ -179,6 +179,7 @@ constexpr gfx::Size kUnifiedFeaturePodSize(112, 88);
constexpr gfx::Size kUnifiedFeaturePodCollapsedSize(48, 48);
constexpr gfx::Insets kUnifiedFeaturePodIconPadding(4);
constexpr gfx::Insets kUnifiedFeaturePodHoverPadding(2);
constexpr int kUnifiedFeaturePodVectorIconSize = 24;
constexpr int kUnifiedFeaturePodLabelWidth = 80;
constexpr int kUnifiedFeaturePodSpacing = 6;
constexpr int kUnifiedFeaturePodHoverRadius = 4;
......
......@@ -16,6 +16,7 @@ aggregate_vector_icons("components_vector_icons") {
"close.icon",
"close_rounded.icon",
"edit.icon",
"ethernet.icon",
"folder.icon",
"folder_managed.icon",
"folder_managed_touch.icon",
......
// Copyright 2018 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, 17, 6,
R_LINE_TO, -1.41f, 1.41f,
LINE_TO, 20.17f, 12,
R_LINE_TO, -4.58f, 4.59f,
LINE_TO, 17, 18,
R_LINE_TO, 6, -6,
R_LINE_TO, -6, -6,
CLOSE,
MOVE_TO, 8.41f, 7.41f,
LINE_TO, 7, 6,
R_LINE_TO, -6, 6,
R_LINE_TO, 6, 6,
R_LINE_TO, 1.41f, -1.41f,
LINE_TO, 3.83f, 12,
R_LINE_TO, 4.58f, -4.59f,
CLOSE,
MOVE_TO, 8, 13,
R_CUBIC_TO, 0.55f, 0, 1, -0.45f, 1, -1,
R_CUBIC_TO, 0, -0.55f, -0.45f, -1, -1, -1,
R_CUBIC_TO, -0.55f, 0, -1, 0.45f, -1, 1,
R_CUBIC_TO, 0, 0.55f, 0.45f, 1, 1, 1,
CLOSE,
R_MOVE_TO, 4, 0,
R_CUBIC_TO, 0.55f, 0, 1, -0.45f, 1, -1,
R_CUBIC_TO, 0, -0.55f, -0.45f, -1, -1, -1,
R_CUBIC_TO, -0.55f, 0, -1, 0.45f, -1, 1,
R_CUBIC_TO, 0, 0.55f, 0.45f, 1, 1, 1,
CLOSE,
R_MOVE_TO, 4, 0,
R_CUBIC_TO, 0.55f, 0, 1, -0.45f, 1, -1,
R_CUBIC_TO, 0, -0.55f, -0.45f, -1, -1, -1,
R_CUBIC_TO, -0.55f, 0, -1, 0.45f, -1, 1,
R_CUBIC_TO, 0, 0.55f, 0.45f, 1, 1, 1,
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