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

Side by Side Diff: ash/system/chromeos/screen_security/screen_capture_tray_item.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
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/system/chromeos/screen_security/screen_capture_tray_item.h" 5 #include "ash/system/chromeos/screen_security/screen_capture_tray_item.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/system_notifier.h" 8 #include "ash/system/system_notifier.h"
9 #include "grit/ash_resources.h" 9 #include "grit/ash_resources.h"
10 #include "grit/ash_strings.h" 10 #include "grit/ash_strings.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 IDS_ASH_STATUS_TRAY_SCREEN_CAPTURE_STOP))); 51 IDS_ASH_STATUS_TRAY_SCREEN_CAPTURE_STOP)));
52 return default_view(); 52 return default_view();
53 } 53 }
54 54
55 void ScreenCaptureTrayItem::CreateOrUpdateNotification() { 55 void ScreenCaptureTrayItem::CreateOrUpdateNotification() {
56 message_center::RichNotificationData data; 56 message_center::RichNotificationData data;
57 data.buttons.push_back(message_center::ButtonInfo( 57 data.buttons.push_back(message_center::ButtonInfo(
58 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_CAPTURE_STOP))); 58 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_CAPTURE_STOP)));
59 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); 59 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance();
60 scoped_ptr<Notification> notification(new Notification( 60 scoped_ptr<Notification> notification(new Notification(
61 message_center::NOTIFICATION_TYPE_SIMPLE, 61 message_center::NOTIFICATION_TYPE_SIMPLE, kScreenCaptureNotificationId,
62 kScreenCaptureNotificationId, 62 screen_capture_status_, base::string16() /* body is blank */,
63 screen_capture_status_,
64 base::string16() /* body is blank */,
65 resource_bundle.GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE_DARK), 63 resource_bundle.GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE_DARK),
66 base::string16() /* display_source */, 64 base::string16() /* display_source */, GURL(),
67 message_center::NotifierId( 65 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT,
68 message_center::NotifierId::SYSTEM_COMPONENT, 66 system_notifier::kNotifierScreenCapture),
69 system_notifier::kNotifierScreenCapture), 67 data, new tray::ScreenNotificationDelegate(this)));
70 data,
71 new tray::ScreenNotificationDelegate(this)));
72 notification->SetSystemPriority(); 68 notification->SetSystemPriority();
73 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); 69 message_center::MessageCenter::Get()->AddNotification(notification.Pass());
74 } 70 }
75 71
76 std::string ScreenCaptureTrayItem::GetNotificationId() { 72 std::string ScreenCaptureTrayItem::GetNotificationId() {
77 return kScreenCaptureNotificationId; 73 return kScreenCaptureNotificationId;
78 } 74 }
79 75
80 void ScreenCaptureTrayItem::OnScreenCaptureStart( 76 void ScreenCaptureTrayItem::OnScreenCaptureStart(
81 const base::Closure& stop_callback, 77 const base::Closure& stop_callback,
(...skipping 18 matching lines...) Expand all
100 // screen capture is stopped externally. 96 // screen capture is stopped externally.
101 set_is_started(false); 97 set_is_started(false);
102 Update(); 98 Update();
103 } 99 }
104 100
105 void ScreenCaptureTrayItem::OnCastingSessionStartedOrStopped(bool started) { 101 void ScreenCaptureTrayItem::OnCastingSessionStartedOrStopped(bool started) {
106 is_casting_ = started; 102 is_casting_ = started;
107 } 103 }
108 104
109 } // namespace ash 105 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/power/tray_power.cc ('k') | ash/system/chromeos/screen_security/screen_share_tray_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698