Commit 2f1956ac authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Add material design icon to mobile data notifications.

This CL adds new material design icon to mobile data notifications.
This CL also adds title "Mobile Data" to the notification.

The icon is effective only when
chrome://flags/#enable-message-center-new-style-notification
is Enabled (which is ToT default).

TEST=manual
BUG=726241

Change-Id: Ia71759dbbe44b1472721c784bb4e1c59b9a7df53
Reviewed-on: https://chromium-review.googlesource.com/666399
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502798}
parent 5877bb2b
...@@ -4369,6 +4369,9 @@ All users must sign out to continue. ...@@ -4369,6 +4369,9 @@ All users must sign out to continue.
</message> </message>
<!-- 3G data Notifications --> <!-- 3G data Notifications -->
<message name="IDS_MOBILE_DATA_NOTIFICATION_TITLE" desc="Title of notification telling that mobile data is enabled.">
Mobile data
</message>
<message name="IDS_3G_NOTIFICATION_MESSAGE" desc="Text of the 3G data notification telling that 3G data is enabled."> <message name="IDS_3G_NOTIFICATION_MESSAGE" desc="Text of the 3G data notification telling that 3G data is enabled.">
Google Chrome will use mobile data if you're not connected to another network. Google Chrome will use mobile data if you're not connected to another network.
</message> </message>
......
...@@ -125,6 +125,7 @@ aggregate_vector_icons("chrome_vector_icons") { ...@@ -125,6 +125,7 @@ aggregate_vector_icons("chrome_vector_icons") {
"arc_migrate_encryption_notification.icon", "arc_migrate_encryption_notification.icon",
"notification_captive_portal.icon", "notification_captive_portal.icon",
"notification_google.icon", "notification_google.icon",
"notification_mobile_data.icon",
"notification_play_prism.icon", "notification_play_prism.icon",
"notification_storage_full.icon", "notification_storage_full.icon",
"notification_warning.icon", "notification_warning.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, 18,
MOVE_TO, 2, 16,
R_H_LINE_TO, 14,
V_LINE_TO, 2,
CLOSE,
END
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/login/helper.h" #include "chrome/browser/chromeos/login/helper.h"
#include "chrome/browser/chromeos/mobile_config.h" #include "chrome/browser/chromeos/mobile_config.h"
...@@ -267,11 +268,21 @@ void DataPromoNotification::ShowOptionalMobileDataPromoNotification() { ...@@ -267,11 +268,21 @@ void DataPromoNotification::ShowOptionalMobileDataPromoNotification() {
const gfx::Image& icon = const gfx::Image& icon =
ui::ResourceBundle::GetSharedInstance().GetImageNamed(icon_id); ui::ResourceBundle::GetSharedInstance().GetImageNamed(icon_id);
std::unique_ptr<message_center::Notification> notification =
ash::system_notifier::CreateSystemNotification(
message_center::NOTIFICATION_TYPE_SIMPLE, kDataPromoNotificationId,
l10n_util::GetStringUTF16(IDS_MOBILE_DATA_NOTIFICATION_TITLE),
message, icon, base::string16() /* display_source */, GURL(),
message_center::NotifierId(
message_center::NotifierId::SYSTEM_COMPONENT,
ash::system_notifier::kNotifierNetwork),
message_center::RichNotificationData(),
new message_center::HandleNotificationClickedDelegate(base::Bind(
&NotificationClicked, default_network->guid(), info_url)),
kNotificationMobileDataIcon,
message_center::SystemNotificationWarningLevel::NORMAL);
message_center::MessageCenter::Get()->AddNotification( message_center::MessageCenter::Get()->AddNotification(
message_center::Notification::CreateSystemNotification( std::move(notification));
kDataPromoNotificationId, base::string16() /* title */, message, icon,
ash::system_notifier::kNotifierNetwork,
base::Bind(&NotificationClicked, default_network->guid(), info_url)));
SetShow3gPromoNotification(false); SetShow3gPromoNotification(false);
if (carrier_deal_promo_pref != kNotificationCountPrefDefault) if (carrier_deal_promo_pref != kNotificationCountPrefDefault)
...@@ -304,11 +315,20 @@ bool DataPromoNotification::ShowDataSaverNotification() { ...@@ -304,11 +315,20 @@ bool DataPromoNotification::ShowDataSaverNotification() {
ui::ResourceBundle::GetSharedInstance().GetImageNamed( ui::ResourceBundle::GetSharedInstance().GetImageNamed(
IDR_AURA_UBER_TRAY_NETWORK_NOTIFICATION_DATASAVER); IDR_AURA_UBER_TRAY_NETWORK_NOTIFICATION_DATASAVER);
message_center::MessageCenter::Get()->AddNotification( std::unique_ptr<message_center::Notification> notification =
message_center::Notification::CreateSystemNotification( message_center::Notification::CreateSystemNotification(
kDataSaverNotificationId, title, message, icon, message_center::NOTIFICATION_TYPE_SIMPLE, kDataSaverNotificationId,
ash::system_notifier::kNotifierNetwork, title, message, icon, base::string16() /* display_source */, GURL(),
base::Bind(&NotificationClicked, "", kDataSaverExtensionUrl))); message_center::NotifierId(
message_center::NotifierId::SYSTEM_COMPONENT,
ash::system_notifier::kNotifierNetwork),
message_center::RichNotificationData(),
new message_center::HandleNotificationClickedDelegate(
base::Bind(&NotificationClicked, "", kDataSaverExtensionUrl)),
kNotificationMobileDataIcon,
message_center::SystemNotificationWarningLevel::NORMAL);
message_center::MessageCenter::Get()->AddNotification(
std::move(notification));
base::RecordAction(base::UserMetricsAction("DataSaverPrompt_Shown")); base::RecordAction(base::UserMetricsAction("DataSaverPrompt_Shown"));
if (DataSaverSwitchDemoMode()) { if (DataSaverSwitchDemoMode()) {
......
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