| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/tiles/tray_tiles.h" | 5 #include "ash/system/tiles/tray_tiles.h" |
| 6 | 6 |
| 7 #include "ash/metrics/user_metrics_action.h" | 7 #include "ash/metrics/user_metrics_action.h" |
| 8 #include "ash/session/session_state_delegate.h" | |
| 9 #include "ash/system/tiles/tiles_default_view.h" | 8 #include "ash/system/tiles/tiles_default_view.h" |
| 10 | 9 |
| 11 namespace ash { | 10 namespace ash { |
| 12 | 11 |
| 13 TrayTiles::TrayTiles(SystemTray* system_tray) | 12 TrayTiles::TrayTiles(SystemTray* system_tray) |
| 14 : SystemTrayItem(system_tray, UMA_NOT_RECORDED), default_view_(nullptr) {} | 13 : SystemTrayItem(system_tray, UMA_NOT_RECORDED), default_view_(nullptr) {} |
| 15 | 14 |
| 16 TrayTiles::~TrayTiles() {} | 15 TrayTiles::~TrayTiles() {} |
| 17 | 16 |
| 18 views::View* TrayTiles::GetHelpButtonView() const { | 17 views::View* TrayTiles::GetHelpButtonView() const { |
| 19 if (!default_view_) | 18 if (!default_view_) |
| 20 return nullptr; | 19 return nullptr; |
| 21 return default_view_->GetHelpButtonView(); | 20 return default_view_->GetHelpButtonView(); |
| 22 } | 21 } |
| 23 | 22 |
| 24 TilesDefaultView* TrayTiles::GetDefaultViewForTesting() const { | 23 TilesDefaultView* TrayTiles::GetDefaultViewForTesting() const { |
| 25 return default_view_; | 24 return default_view_; |
| 26 } | 25 } |
| 27 | 26 |
| 28 views::View* TrayTiles::CreateDefaultViewForTesting(LoginStatus status) { | 27 views::View* TrayTiles::CreateDefaultViewForTesting() { |
| 29 return CreateDefaultView(status); | 28 // Login status is unused. |
| 29 return CreateDefaultView(LoginStatus::USER); |
| 30 } | 30 } |
| 31 | 31 |
| 32 views::View* TrayTiles::CreateDefaultView(LoginStatus status) { | 32 views::View* TrayTiles::CreateDefaultView(LoginStatus status) { |
| 33 CHECK(default_view_ == nullptr); | 33 CHECK(default_view_ == nullptr); |
| 34 default_view_ = new TilesDefaultView(this, status); | 34 default_view_ = new TilesDefaultView(this); |
| 35 default_view_->Init(); | 35 default_view_->Init(); |
| 36 return default_view_; | 36 return default_view_; |
| 37 } | 37 } |
| 38 | 38 |
| 39 void TrayTiles::DestroyDefaultView() { | 39 void TrayTiles::DestroyDefaultView() { |
| 40 default_view_ = nullptr; | 40 default_view_ = nullptr; |
| 41 } | 41 } |
| 42 | 42 |
| 43 } // namespace ash | 43 } // namespace ash |
| OLD | NEW |