| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/tray/tray_details_view.h" | 5 #include "ash/system/tray/tray_details_view.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/shelf/shelf_widget.h" | 8 #include "ash/shelf/shelf_widget.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/system/status_area_widget.h" | 10 #include "ash/system/status_area_widget.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 DISALLOW_COPY_AND_ASSIGN(TestDetailsView); | 75 DISALLOW_COPY_AND_ASSIGN(TestDetailsView); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 // Trivial item implementation that tracks its views for testing. | 78 // Trivial item implementation that tracks its views for testing. |
| 79 class TestItem : public SystemTrayItem { | 79 class TestItem : public SystemTrayItem { |
| 80 public: | 80 public: |
| 81 TestItem() : SystemTrayItem(GetSystemTray()), tray_view_(NULL) {} | 81 TestItem() : SystemTrayItem(GetSystemTray()), tray_view_(NULL) {} |
| 82 | 82 |
| 83 // Overridden from SystemTrayItem: | 83 // Overridden from SystemTrayItem: |
| 84 views::View* CreateTrayView(user::LoginStatus status) override { | 84 views::View* CreateTrayView(LoginStatus status) override { |
| 85 tray_view_ = new views::View; | 85 tray_view_ = new views::View; |
| 86 return tray_view_; | 86 return tray_view_; |
| 87 } | 87 } |
| 88 views::View* CreateDefaultView(user::LoginStatus status) override { | 88 views::View* CreateDefaultView(LoginStatus status) override { |
| 89 default_view_ = new views::View; | 89 default_view_ = new views::View; |
| 90 default_view_->SetFocusBehavior(views::View::FocusBehavior::ALWAYS); | 90 default_view_->SetFocusBehavior(views::View::FocusBehavior::ALWAYS); |
| 91 return default_view_; | 91 return default_view_; |
| 92 } | 92 } |
| 93 views::View* CreateDetailedView(user::LoginStatus status) override { | 93 views::View* CreateDetailedView(LoginStatus status) override { |
| 94 detailed_view_ = new TestDetailsView(this); | 94 detailed_view_ = new TestDetailsView(this); |
| 95 return detailed_view_; | 95 return detailed_view_; |
| 96 } | 96 } |
| 97 void DestroyTrayView() override { tray_view_ = NULL; } | 97 void DestroyTrayView() override { tray_view_ = NULL; } |
| 98 void DestroyDefaultView() override { default_view_ = NULL; } | 98 void DestroyDefaultView() override { default_view_ = NULL; } |
| 99 void DestroyDetailedView() override { detailed_view_ = NULL; } | 99 void DestroyDetailedView() override { detailed_view_ = NULL; } |
| 100 | 100 |
| 101 views::View* tray_view() const { return tray_view_; } | 101 views::View* tray_view() const { return tray_view_; } |
| 102 views::View* default_view() const { return default_view_; } | 102 views::View* default_view() const { return default_view_; } |
| 103 TestDetailsView* detailed_view() const { return detailed_view_; } | 103 TestDetailsView* detailed_view() const { return detailed_view_; } |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 gfx::Rect bounds = button->GetBoundsInScreen(); | 274 gfx::Rect bounds = button->GetBoundsInScreen(); |
| 275 gfx::Point initial_point(bounds.x() - 1, bounds.y()); | 275 gfx::Point initial_point(bounds.x() - 1, bounds.y()); |
| 276 generator.set_current_location(initial_point); | 276 generator.set_current_location(initial_point); |
| 277 generator.MoveMouseBy(1, 0); | 277 generator.MoveMouseBy(1, 0); |
| 278 RunAllPendingInMessageLoop(); | 278 RunAllPendingInMessageLoop(); |
| 279 EXPECT_TRUE(button->background()); | 279 EXPECT_TRUE(button->background()); |
| 280 } | 280 } |
| 281 | 281 |
| 282 } // namespace test | 282 } // namespace test |
| 283 } // namespace ash | 283 } // namespace ash |
| OLD | NEW |