| 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/screen_layout_observer.h" | 5 #include "ash/system/chromeos/screen_layout_observer.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "grit/ash_resources.h" | 25 #include "grit/ash_resources.h" |
| 26 #include "grit/ash_strings.h" | 26 #include "grit/ash_strings.h" |
| 27 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
| 28 #include "ui/base/resource/resource_bundle.h" | 28 #include "ui/base/resource/resource_bundle.h" |
| 29 #include "ui/display/display.h" | 29 #include "ui/display/display.h" |
| 30 #include "ui/display/manager/display_manager.h" | 30 #include "ui/display/manager/display_manager.h" |
| 31 #include "ui/display/types/display_constants.h" | 31 #include "ui/display/types/display_constants.h" |
| 32 #include "ui/message_center/message_center.h" | 32 #include "ui/message_center/message_center.h" |
| 33 #include "ui/message_center/notification.h" | 33 #include "ui/message_center/notification.h" |
| 34 #include "ui/message_center/notification_delegate.h" | 34 #include "ui/message_center/notification_delegate.h" |
| 35 #include "ui/strings/grit/ui_strings.h" |
| 35 | 36 |
| 36 using message_center::Notification; | 37 using message_center::Notification; |
| 37 | 38 |
| 38 namespace ash { | 39 namespace ash { |
| 39 namespace { | 40 namespace { |
| 40 | 41 |
| 41 display::DisplayManager* GetDisplayManager() { | 42 display::DisplayManager* GetDisplayManager() { |
| 42 return Shell::GetInstance()->display_manager(); | 43 return Shell::GetInstance()->display_manager(); |
| 43 } | 44 } |
| 44 | 45 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 int64_t external_id = display::kInvalidDisplayId; | 111 int64_t external_id = display::kInvalidDisplayId; |
| 111 for (size_t i = 0; i < display_manager->GetNumDisplays(); ++i) { | 112 for (size_t i = 0; i < display_manager->GetNumDisplays(); ++i) { |
| 112 int64_t id = display_manager->GetDisplayAt(i).id(); | 113 int64_t id = display_manager->GetDisplayAt(i).id(); |
| 113 if (!display::Display::IsInternalDisplayId(id)) { | 114 if (!display::Display::IsInternalDisplayId(id)) { |
| 114 external_id = id; | 115 external_id = id; |
| 115 break; | 116 break; |
| 116 } | 117 } |
| 117 } | 118 } |
| 118 | 119 |
| 119 if (external_id == display::kInvalidDisplayId) | 120 if (external_id == display::kInvalidDisplayId) |
| 120 return l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_UNKNOWN_DISPLAY_NAME); | 121 return l10n_util::GetStringUTF16(IDS_DISPLAY_NAME_UNKNOWN); |
| 121 | 122 |
| 122 // The external display name may have an annotation of "(width x height)" in | 123 // The external display name may have an annotation of "(width x height)" in |
| 123 // case that the display is rotated or its resolution is changed. | 124 // case that the display is rotated or its resolution is changed. |
| 124 base::string16 name = GetDisplayName(external_id); | 125 base::string16 name = GetDisplayName(external_id); |
| 125 const display::ManagedDisplayInfo& display_info = | 126 const display::ManagedDisplayInfo& display_info = |
| 126 display_manager->GetDisplayInfo(external_id); | 127 display_manager->GetDisplayInfo(external_id); |
| 127 if (display_info.GetActiveRotation() != display::Display::ROTATE_0 || | 128 if (display_info.GetActiveRotation() != display::Display::ROTATE_0 || |
| 128 display_info.configured_ui_scale() != 1.0f || | 129 display_info.configured_ui_scale() != 1.0f || |
| 129 !display_info.overscan_insets_in_dip().IsEmpty()) { | 130 !display_info.overscan_insets_in_dip().IsEmpty()) { |
| 130 name = | 131 name = |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 if (!show_notifications_for_testing) | 307 if (!show_notifications_for_testing) |
| 307 return; | 308 return; |
| 308 | 309 |
| 309 base::string16 message; | 310 base::string16 message; |
| 310 base::string16 additional_message; | 311 base::string16 additional_message; |
| 311 if (GetDisplayMessageForNotification(old_info, &message, &additional_message)) | 312 if (GetDisplayMessageForNotification(old_info, &message, &additional_message)) |
| 312 CreateOrUpdateNotification(message, additional_message); | 313 CreateOrUpdateNotification(message, additional_message); |
| 313 } | 314 } |
| 314 | 315 |
| 315 } // namespace ash | 316 } // namespace ash |
| OLD | NEW |