| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_util.h" | 5 #include "ash/display/display_util.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/common/display/display_info.h" | 9 #include "ash/common/display/display_info.h" |
| 10 #include "ash/common/new_window_delegate.h" |
| 10 #include "ash/common/system/system_notifier.h" | 11 #include "ash/common/system/system_notifier.h" |
| 12 #include "ash/common/wm_shell.h" |
| 11 #include "ash/display/display_manager.h" | 13 #include "ash/display/display_manager.h" |
| 12 #include "ash/host/ash_window_tree_host.h" | 14 #include "ash/host/ash_window_tree_host.h" |
| 13 #include "ash/new_window_delegate.h" | |
| 14 #include "ash/shell.h" | 15 #include "ash/shell.h" |
| 15 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 16 #include "grit/ash_resources.h" | 17 #include "grit/ash_resources.h" |
| 17 #include "ui/aura/env.h" | 18 #include "ui/aura/env.h" |
| 18 #include "ui/aura/window_tree_host.h" | 19 #include "ui/aura/window_tree_host.h" |
| 19 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
| 20 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
| 21 #include "ui/display/display.h" | 22 #include "ui/display/display.h" |
| 22 #include "ui/gfx/geometry/point.h" | 23 #include "ui/gfx/geometry/point.h" |
| 23 #include "ui/gfx/geometry/rect.h" | 24 #include "ui/gfx/geometry/rect.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 41 // is clicked. | 42 // is clicked. |
| 42 class DisplayErrorNotificationDelegate | 43 class DisplayErrorNotificationDelegate |
| 43 : public message_center::NotificationDelegate { | 44 : public message_center::NotificationDelegate { |
| 44 public: | 45 public: |
| 45 DisplayErrorNotificationDelegate() = default; | 46 DisplayErrorNotificationDelegate() = default; |
| 46 | 47 |
| 47 // message_center::NotificationDelegate: | 48 // message_center::NotificationDelegate: |
| 48 bool HasClickedListener() override { return true; } | 49 bool HasClickedListener() override { return true; } |
| 49 | 50 |
| 50 void Click() override { | 51 void Click() override { |
| 51 Shell::GetInstance()->new_window_delegate()->OpenFeedbackPage(); | 52 WmShell::Get()->new_window_delegate()->OpenFeedbackPage(); |
| 52 } | 53 } |
| 53 | 54 |
| 54 private: | 55 private: |
| 55 // Private destructor since NotificationDelegate is ref-counted. | 56 // Private destructor since NotificationDelegate is ref-counted. |
| 56 ~DisplayErrorNotificationDelegate() override = default; | 57 ~DisplayErrorNotificationDelegate() override = default; |
| 57 | 58 |
| 58 DISALLOW_COPY_AND_ASSIGN(DisplayErrorNotificationDelegate); | 59 DISALLOW_COPY_AND_ASSIGN(DisplayErrorNotificationDelegate); |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 // List of value UI Scale values. Scales for 2x are equivalent to 640, | 62 // List of value UI Scale values. Scales for 2x are equivalent to 640, |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 message_center::NotificationList::Notifications notifications = | 468 message_center::NotificationList::Notifications notifications = |
| 468 message_center::MessageCenter::Get()->GetVisibleNotifications(); | 469 message_center::MessageCenter::Get()->GetVisibleNotifications(); |
| 469 for (auto* const notification : notifications) { | 470 for (auto* const notification : notifications) { |
| 470 if (notification->id() == kDisplayErrorNotificationId) | 471 if (notification->id() == kDisplayErrorNotificationId) |
| 471 return notification->message(); | 472 return notification->message(); |
| 472 } | 473 } |
| 473 return base::string16(); | 474 return base::string16(); |
| 474 } | 475 } |
| 475 | 476 |
| 476 } // namespace ash | 477 } // namespace ash |
| OLD | NEW |