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 <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "ash/common/system/chromeos/devicetype_utils.h" | 11 #include "ash/common/system/chromeos/devicetype_utils.h" |
12 #include "ash/common/system/system_notifier.h" | 12 #include "ash/common/system/system_notifier.h" |
13 #include "ash/common/system/tray/actionable_view.h" | 13 #include "ash/common/system/tray/actionable_view.h" |
14 #include "ash/common/system/tray/fixed_sized_image_view.h" | 14 #include "ash/common/system/tray/fixed_sized_image_view.h" |
15 #include "ash/common/system/tray/system_tray_delegate.h" | 15 #include "ash/common/system/tray/system_tray_delegate.h" |
16 #include "ash/common/system/tray/tray_constants.h" | 16 #include "ash/common/system/tray/tray_constants.h" |
17 #include "ash/common/system/tray/tray_notification_view.h" | 17 #include "ash/common/system/tray/tray_notification_view.h" |
18 #include "ash/common/wm_shell.h" | 18 #include "ash/common/wm_shell.h" |
19 #include "ash/display/display_manager.h" | 19 #include "ash/display/display_manager.h" |
20 #include "ash/display/screen_orientation_controller_chromeos.h" | 20 #include "ash/display/screen_orientation_controller_chromeos.h" |
21 #include "ash/display/window_tree_host_manager.h" | |
22 #include "ash/shell.h" | 21 #include "ash/shell.h" |
23 #include "ash/system/tray/system_tray.h" | 22 #include "ash/system/tray/system_tray.h" |
24 #include "base/bind.h" | 23 #include "base/bind.h" |
25 #include "base/strings/string_util.h" | 24 #include "base/strings/string_util.h" |
26 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
27 #include "grit/ash_resources.h" | 26 #include "grit/ash_resources.h" |
28 #include "grit/ash_strings.h" | 27 #include "grit/ash_strings.h" |
29 #include "ui/base/l10n/l10n_util.h" | 28 #include "ui/base/l10n/l10n_util.h" |
30 #include "ui/base/resource/resource_bundle.h" | 29 #include "ui/base/resource/resource_bundle.h" |
31 #include "ui/display/display.h" | 30 #include "ui/display/display.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 } | 291 } |
293 | 292 |
294 views::ImageView* image_; | 293 views::ImageView* image_; |
295 views::Label* label_; | 294 views::Label* label_; |
296 | 295 |
297 DISALLOW_COPY_AND_ASSIGN(DisplayView); | 296 DISALLOW_COPY_AND_ASSIGN(DisplayView); |
298 }; | 297 }; |
299 | 298 |
300 TrayDisplay::TrayDisplay(SystemTray* system_tray) | 299 TrayDisplay::TrayDisplay(SystemTray* system_tray) |
301 : SystemTrayItem(system_tray), default_(NULL) { | 300 : SystemTrayItem(system_tray), default_(NULL) { |
302 Shell::GetInstance()->window_tree_host_manager()->AddObserver(this); | 301 WmShell::Get()->AddDisplayObserver(this); |
303 UpdateDisplayInfo(NULL); | 302 UpdateDisplayInfo(NULL); |
304 } | 303 } |
305 | 304 |
306 TrayDisplay::~TrayDisplay() { | 305 TrayDisplay::~TrayDisplay() { |
307 Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this); | 306 WmShell::Get()->RemoveDisplayObserver(this); |
308 } | 307 } |
309 | 308 |
310 void TrayDisplay::UpdateDisplayInfo(TrayDisplay::DisplayInfoMap* old_info) { | 309 void TrayDisplay::UpdateDisplayInfo(TrayDisplay::DisplayInfoMap* old_info) { |
311 if (old_info) | 310 if (old_info) |
312 old_info->swap(display_info_); | 311 old_info->swap(display_info_); |
313 display_info_.clear(); | 312 display_info_.clear(); |
314 | 313 |
315 DisplayManager* display_manager = GetDisplayManager(); | 314 DisplayManager* display_manager = GetDisplayManager(); |
316 for (size_t i = 0; i < display_manager->GetNumDisplays(); ++i) { | 315 for (size_t i = 0; i < display_manager->GetNumDisplays(); ++i) { |
317 int64_t id = display_manager->GetDisplayAt(i).id(); | 316 int64_t id = display_manager->GetDisplayAt(i).id(); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 bool TrayDisplay::GetAccessibleStateForTesting(ui::AXViewState* state) { | 449 bool TrayDisplay::GetAccessibleStateForTesting(ui::AXViewState* state) { |
451 views::View* view = default_; | 450 views::View* view = default_; |
452 if (view) { | 451 if (view) { |
453 view->GetAccessibleState(state); | 452 view->GetAccessibleState(state); |
454 return true; | 453 return true; |
455 } | 454 } |
456 return false; | 455 return false; |
457 } | 456 } |
458 | 457 |
459 } // namespace ash | 458 } // namespace ash |
OLD | NEW |