Commit 6528d2fc authored by msw's avatar msw Committed by Commit bot

mash: Minor ash/common fixes for tray_display.

Just fixes some low hanging fruit here.
(other big deps on DisplayManager; ScreenOrientationController)

BUG=619636
TEST=compiles; unit tests; no behavior changes.
R=jamescook@chromium.org

Review-Url: https://codereview.chromium.org/2131823003
Cr-Commit-Position: refs/heads/master@{#404516}
parent c7dd0560
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "ash/common/wm_shell.h" #include "ash/common/wm_shell.h"
#include "ash/display/display_manager.h" #include "ash/display/display_manager.h"
#include "ash/display/screen_orientation_controller_chromeos.h" #include "ash/display/screen_orientation_controller_chromeos.h"
#include "ash/display/window_tree_host_manager.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/system/tray/system_tray.h" #include "ash/system/tray/system_tray.h"
#include "base/bind.h" #include "base/bind.h"
...@@ -299,12 +298,12 @@ class DisplayView : public ActionableView { ...@@ -299,12 +298,12 @@ class DisplayView : public ActionableView {
TrayDisplay::TrayDisplay(SystemTray* system_tray) TrayDisplay::TrayDisplay(SystemTray* system_tray)
: SystemTrayItem(system_tray), default_(NULL) { : SystemTrayItem(system_tray), default_(NULL) {
Shell::GetInstance()->window_tree_host_manager()->AddObserver(this); WmShell::Get()->AddDisplayObserver(this);
UpdateDisplayInfo(NULL); UpdateDisplayInfo(NULL);
} }
TrayDisplay::~TrayDisplay() { TrayDisplay::~TrayDisplay() {
Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this); WmShell::Get()->RemoveDisplayObserver(this);
} }
void TrayDisplay::UpdateDisplayInfo(TrayDisplay::DisplayInfoMap* old_info) { void TrayDisplay::UpdateDisplayInfo(TrayDisplay::DisplayInfoMap* old_info) {
......
...@@ -12,25 +12,21 @@ ...@@ -12,25 +12,21 @@
#include "ash/ash_export.h" #include "ash/ash_export.h"
#include "ash/common/display/display_info.h" #include "ash/common/display/display_info.h"
#include "ash/common/system/tray/system_tray_item.h" #include "ash/common/system/tray/system_tray_item.h"
#include "ash/display/window_tree_host_manager.h" #include "ash/common/wm_display_observer.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "ui/views/view.h" #include "ui/views/view.h"
namespace ash { namespace ash {
class DisplayView;
namespace test { class DisplayView;
class AshTestBase;
}
class ASH_EXPORT TrayDisplay : public SystemTrayItem, class ASH_EXPORT TrayDisplay : public SystemTrayItem, public WmDisplayObserver {
public WindowTreeHostManager::Observer {
public: public:
explicit TrayDisplay(SystemTray* system_tray); explicit TrayDisplay(SystemTray* system_tray);
~TrayDisplay() override; ~TrayDisplay() override;
// Overridden from WindowTreeHostManagerObserver: // Overridden from WmDisplayObserver:
void OnDisplayConfigurationChanged() override; void OnDisplayConfigurationChanged() override;
private: private:
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "ash/common/system/chromeos/devicetype_utils.h" #include "ash/common/system/chromeos/devicetype_utils.h"
#include "ash/display/display_manager.h" #include "ash/display/display_manager.h"
#include "ash/root_window_controller.h"
#include "ash/screen_util.h" #include "ash/screen_util.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/system/tray/system_tray.h" #include "ash/system/tray/system_tray.h"
...@@ -126,8 +125,7 @@ TrayDisplay* TrayDisplayTest::GetTrayDisplay() { ...@@ -126,8 +125,7 @@ TrayDisplay* TrayDisplayTest::GetTrayDisplay() {
} }
void TrayDisplayTest::CheckUpdate() { void TrayDisplayTest::CheckUpdate() {
SystemTray* current = SystemTray* current = GetPrimarySystemTray();
Shell::GetPrimaryRootWindowController()->GetSystemTray();
if (tray_ != current) { if (tray_ != current) {
tray_ = current; tray_ = current;
tray_display_ = new TrayDisplay(tray_); tray_display_ = new TrayDisplay(tray_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment