Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: ash/display/display_error_observer_chromeos.cc

Issue 1292003004: Elide origins displayed on web notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Style nit Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ash/display/resolution_notification_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/display/display_error_observer_chromeos.h" 5 #include "ash/display/display_error_observer_chromeos.h"
6 6
7 #include "ash/system/system_notifier.h" 7 #include "ash/system/system_notifier.h"
8 #include "grit/ash_resources.h" 8 #include "grit/ash_resources.h"
9 #include "grit/ash_strings.h" 9 #include "grit/ash_strings.h"
10 #include "ui/base/l10n/l10n_util.h" 10 #include "ui/base/l10n/l10n_util.h"
(...skipping 25 matching lines...) Expand all
36 // as a popup in any situation. 36 // as a popup in any situation.
37 message_center::MessageCenter::Get()->RemoveNotification( 37 message_center::MessageCenter::Get()->RemoveNotification(
38 kDisplayErrorNotificationId, false /* by_user */); 38 kDisplayErrorNotificationId, false /* by_user */);
39 39
40 int message_id = (new_state == ui::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR) ? 40 int message_id = (new_state == ui::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR) ?
41 IDS_ASH_DISPLAY_FAILURE_ON_MIRRORING : 41 IDS_ASH_DISPLAY_FAILURE_ON_MIRRORING :
42 IDS_ASH_DISPLAY_FAILURE_ON_NON_MIRRORING; 42 IDS_ASH_DISPLAY_FAILURE_ON_NON_MIRRORING;
43 43
44 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); 44 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
45 scoped_ptr<Notification> notification(new Notification( 45 scoped_ptr<Notification> notification(new Notification(
46 message_center::NOTIFICATION_TYPE_SIMPLE, 46 message_center::NOTIFICATION_TYPE_SIMPLE, kDisplayErrorNotificationId,
47 kDisplayErrorNotificationId,
48 base::string16(), // title 47 base::string16(), // title
49 l10n_util::GetStringUTF16(message_id), 48 l10n_util::GetStringUTF16(message_id),
50 bundle.GetImageNamed(IDR_AURA_NOTIFICATION_DISPLAY), 49 bundle.GetImageNamed(IDR_AURA_NOTIFICATION_DISPLAY),
51 base::string16(), // display_source 50 base::string16(), // display_source
51 GURL(),
52 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, 52 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT,
53 system_notifier::kNotifierDisplayError), 53 system_notifier::kNotifierDisplayError),
54 message_center::RichNotificationData(), NULL)); 54 message_center::RichNotificationData(), NULL));
55 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); 55 message_center::MessageCenter::Get()->AddNotification(notification.Pass());
56 } 56 }
57 57
58 base::string16 58 base::string16
59 DisplayErrorObserver::GetDisplayErrorNotificationMessageForTest() { 59 DisplayErrorObserver::GetDisplayErrorNotificationMessageForTest() {
60 message_center::NotificationList::Notifications notifications = 60 message_center::NotificationList::Notifications notifications =
61 message_center::MessageCenter::Get()->GetVisibleNotifications(); 61 message_center::MessageCenter::Get()->GetVisibleNotifications();
62 for (message_center::NotificationList::Notifications::const_iterator iter = 62 for (message_center::NotificationList::Notifications::const_iterator iter =
63 notifications.begin(); iter != notifications.end(); ++iter) { 63 notifications.begin(); iter != notifications.end(); ++iter) {
64 if ((*iter)->id() == kDisplayErrorNotificationId) 64 if ((*iter)->id() == kDisplayErrorNotificationId)
65 return (*iter)->message(); 65 return (*iter)->message();
66 } 66 }
67 67
68 return base::string16(); 68 return base::string16();
69 } 69 }
70 70
71 } // namespace ash 71 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/display/resolution_notification_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698