OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tray_display.h" | 5 #include "ash/system/chromeos/tray_display.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/system/system_notifier.h" | 10 #include "ash/system/system_notifier.h" |
11 #include "ash/system/tray/actionable_view.h" | 11 #include "ash/system/tray/actionable_view.h" |
12 #include "ash/system/tray/fixed_sized_image_view.h" | 12 #include "ash/system/tray/fixed_sized_image_view.h" |
13 #include "ash/system/tray/system_tray.h" | 13 #include "ash/system/tray/system_tray.h" |
14 #include "ash/system/tray/system_tray_delegate.h" | 14 #include "ash/system/tray/system_tray_delegate.h" |
15 #include "ash/system/tray/tray_constants.h" | 15 #include "ash/system/tray/tray_constants.h" |
16 #include "ash/system/tray/tray_notification_view.h" | 16 #include "ash/system/tray/tray_notification_view.h" |
| 17 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
17 #include "base/bind.h" | 18 #include "base/bind.h" |
18 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
19 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
20 #include "grit/ash_resources.h" | 21 #include "grit/ash_resources.h" |
21 #include "grit/ash_strings.h" | 22 #include "grit/ash_strings.h" |
22 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
23 #include "ui/base/resource/resource_bundle.h" | 24 #include "ui/base/resource/resource_bundle.h" |
24 #include "ui/message_center/message_center.h" | 25 #include "ui/message_center/message_center.h" |
25 #include "ui/message_center/notification.h" | 26 #include "ui/message_center/notification.h" |
26 #include "ui/message_center/notification_delegate.h" | 27 #include "ui/message_center/notification_delegate.h" |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 message, | 382 message, |
382 additional_message, | 383 additional_message, |
383 bundle.GetImageNamed(IDR_AURA_NOTIFICATION_DISPLAY), | 384 bundle.GetImageNamed(IDR_AURA_NOTIFICATION_DISPLAY), |
384 base::string16(), // display_source | 385 base::string16(), // display_source |
385 message_center::NotifierId( | 386 message_center::NotifierId( |
386 message_center::NotifierId::SYSTEM_COMPONENT, | 387 message_center::NotifierId::SYSTEM_COMPONENT, |
387 system_notifier::kNotifierDisplay), | 388 system_notifier::kNotifierDisplay), |
388 message_center::RichNotificationData(), | 389 message_center::RichNotificationData(), |
389 new message_center::HandleNotificationClickedDelegate( | 390 new message_center::HandleNotificationClickedDelegate( |
390 base::Bind(&OpenSettings)))); | 391 base::Bind(&OpenSettings)))); |
391 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); | 392 |
| 393 // Don't display notifications for accelerometer triggered screen rotations. |
| 394 // See http://crbug.com/364949 |
| 395 if (!Shell::GetInstance()->maximize_mode_controller()-> |
| 396 in_set_screen_rotation()) { |
| 397 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); |
| 398 } |
392 } | 399 } |
393 | 400 |
394 views::View* TrayDisplay::CreateDefaultView(user::LoginStatus status) { | 401 views::View* TrayDisplay::CreateDefaultView(user::LoginStatus status) { |
395 DCHECK(default_ == NULL); | 402 DCHECK(default_ == NULL); |
396 default_ = new DisplayView(); | 403 default_ = new DisplayView(); |
397 return default_; | 404 return default_; |
398 } | 405 } |
399 | 406 |
400 void TrayDisplay::DestroyDefaultView() { | 407 void TrayDisplay::DestroyDefaultView() { |
401 default_ = NULL; | 408 default_ = NULL; |
(...skipping 27 matching lines...) Expand all Loading... |
429 bool TrayDisplay::GetAccessibleStateForTesting(ui::AXViewState* state) { | 436 bool TrayDisplay::GetAccessibleStateForTesting(ui::AXViewState* state) { |
430 views::View* view = default_; | 437 views::View* view = default_; |
431 if (view) { | 438 if (view) { |
432 view->GetAccessibleState(state); | 439 view->GetAccessibleState(state); |
433 return true; | 440 return true; |
434 } | 441 } |
435 return false; | 442 return false; |
436 } | 443 } |
437 | 444 |
438 } // namespace ash | 445 } // namespace ash |
OLD | NEW |