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