Commit ad7cb9c7 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Remove default context title for some system notifications.

As a workaround for M62, we were setting default context title
|display_source| for some specific notifications.
For the detailed background, see the original CL
https://crrev.com/c/662501 and the bug https://crbug.com/761900 .

As all the caller side fixes have been landed, and the workaround
is merged to M62 release branch, we can now remove this.

Caller side fix CLs:
* ARC notifications
  https://crrev.com/c/647391
  https://crrev.com/c/654119
* Sign-in error notifications
  https://crrev.com/c/648891
  https://crrev.com/c/657138
* HaTS notification https://crrev.com/c/646413
* CUPS notification https://crrev.com/c/648539

TEST=manual
BUG=none

Change-Id: Ie358b8a2070ff3870629d0b6d46e2a2b2fc9f5ba
Reviewed-on: https://chromium-review.googlesource.com/662485Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501543}
parent e7a43306
...@@ -110,44 +110,6 @@ gfx::FontList GetTextFontList() { ...@@ -110,44 +110,6 @@ gfx::FontList GetTextFontList() {
return gfx::FontList(font); return gfx::FontList(font);
} }
#if defined(OS_CHROMEOS)
// Return true if the default |display_source| should be used for the
// notifications from the notifier.
//
// Ideally, we shuold fix the callers to set appropriate |display_source|, but
// string resource is frozen in M62. For now, we should use this to prevent
// empty |display_source| in system notifications.
// TODO(tetsui): Remove this hack after M62 is released.
bool ShowDefaultDisplaySource(const NotifierId& notifier) {
// The string constants are written in plain to prevent circular dependencies.
// This should not be accepted usually but I think it's OK here, as this
// function has a clear plan to be removed soon.
return notifier.type == NotifierId::SYSTEM_COMPONENT &&
(
// ARC notification.
// chrome/browser/chromeos/arc/arc_auth_notification.cc
notifier.id == "arc_auth" ||
// chrome/browser/chromeos/arc/notification/
// arc_boot_error_notification.cc
notifier.id == "arc_boot_error" ||
// chrome/browser/chromeos/arc/notification/
// arc_provision_notification_service.cc
notifier.id == "arc_managed_provision" ||
// Happiness survey notification.
// chrome/browser/chromeos/hats/hats_notification_controller.cc
notifier.id == "ash.hats" ||
// Sign-in error notification.
// chrome/browser/signin/signin_error_notifier_ash.cc
// chrome/browser/chromeos/authpolicy/
// auth_policy_credentials_manager.cc
notifier.id == "chrome://settings/signin/" ||
// CUPS printing notification.
// chrome/browser/chromeos/printing/cups_print_job_notification.cc
notifier.id ==
"chrome://settings/printing/cups-print-job-notification");
}
#endif
// ItemView //////////////////////////////////////////////////////////////////// // ItemView ////////////////////////////////////////////////////////////////////
// ItemViews are responsible for drawing each list notification item's title and // ItemViews are responsible for drawing each list notification item's title and
...@@ -628,9 +590,8 @@ void NotificationViewMD::CreateOrUpdateContextTitleView( ...@@ -628,9 +590,8 @@ void NotificationViewMD::CreateOrUpdateContextTitleView(
// TODO(tetsui): Remove this after all system notification transition is // TODO(tetsui): Remove this after all system notification transition is
// completed. // completed.
// All system notification should use Notification::CreateSystemNotification() // All system notification should use Notification::CreateSystemNotification()
if ((notification.display_source().empty() && if (notification.display_source().empty() &&
notification.origin_url().is_empty()) || notification.origin_url().is_empty()) {
ShowDefaultDisplaySource(notification.notifier_id())) {
header_row_->SetAppName(l10n_util::GetStringFUTF16( header_row_->SetAppName(l10n_util::GetStringFUTF16(
IDS_MESSAGE_CENTER_NOTIFICATION_CHROMEOS_SYSTEM, IDS_MESSAGE_CENTER_NOTIFICATION_CHROMEOS_SYSTEM,
MessageCenter::Get()->GetProductOSName())); MessageCenter::Get()->GetProductOSName()));
......
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