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

Side by Side Diff: chrome/browser/ui/views/message_center/web_notification_tray.cc

Issue 114323002: Fixes the context menu for a notification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix2 Created 7 years 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 | Annotate | Revision Log
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 "chrome/browser/ui/views/message_center/web_notification_tray.h" 5 #include "chrome/browser/ui/views/message_center/web_notification_tray.h"
6 6
7 #include "base/i18n/number_formatting.h" 7 #include "base/i18n/number_formatting.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 } 184 }
185 message_center_delegate_ = 185 message_center_delegate_ =
186 new MessageCenterWidgetDelegate(this, 186 new MessageCenterWidgetDelegate(this,
187 message_center_tray_.get(), 187 message_center_tray_.get(),
188 true, // settings initally visible 188 true, // settings initally visible
189 GetPositionInfo()); 189 GetPositionInfo());
190 190
191 return true; 191 return true;
192 } 192 }
193 193
194 bool WebNotificationTray::IsContextMenuEnabled() const {
195 // It can always return true because the notifications are invisible if
196 // the context menu shouldn't be enabled, such as in the lock screen.
197 return true;
198 }
199
194 void WebNotificationTray::OnMessageCenterTrayChanged() { 200 void WebNotificationTray::OnMessageCenterTrayChanged() {
195 if (status_icon_) { 201 if (status_icon_) {
196 bool quiet_mode_state = message_center()->IsQuietMode(); 202 bool quiet_mode_state = message_center()->IsQuietMode();
197 if (last_quiet_mode_state_ != quiet_mode_state) { 203 if (last_quiet_mode_state_ != quiet_mode_state) {
198 last_quiet_mode_state_ = quiet_mode_state; 204 last_quiet_mode_state_ = quiet_mode_state;
199 205
200 // Quiet mode has changed, update the quiet mode menu. 206 // Quiet mode has changed, update the quiet mode menu.
201 status_icon_menu_->SetCommandIdChecked(kToggleQuietMode, 207 status_icon_menu_->SetCommandIdChecked(kToggleQuietMode,
202 quiet_mode_state); 208 quiet_mode_state);
203 } 209 }
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 status_icon_menu_ = menu.get(); 370 status_icon_menu_ = menu.get();
365 status_icon->SetContextMenu(menu.Pass()); 371 status_icon->SetContextMenu(menu.Pass());
366 } 372 }
367 373
368 MessageCenterWidgetDelegate* 374 MessageCenterWidgetDelegate*
369 WebNotificationTray::GetMessageCenterWidgetDelegateForTest() { 375 WebNotificationTray::GetMessageCenterWidgetDelegateForTest() {
370 return message_center_delegate_; 376 return message_center_delegate_;
371 } 377 }
372 378
373 } // namespace message_center 379 } // namespace message_center
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/message_center/web_notification_tray.h ('k') | ui/message_center/message_center.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698