| OLD | NEW |
| 1 /// Copyright 2014 The Chromium Authors. All rights reserved. | 1 /// Copyright 2014 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 "athena/activity/public/activity_factory.h" | 5 #include "athena/activity/public/activity_factory.h" |
| 6 #include "athena/activity/public/activity_manager.h" | 6 #include "athena/activity/public/activity_manager.h" |
| 7 #include "athena/content/app_activity.h" | 7 #include "athena/content/app_activity.h" |
| 8 #include "athena/content/app_activity_registry.h" | 8 #include "athena/content/app_activity_registry.h" |
| 9 #include "athena/content/public/app_registry.h" | 9 #include "athena/content/public/app_registry.h" |
| 10 #include "athena/extensions/public/extensions_delegate.h" | 10 #include "athena/extensions/public/extensions_delegate.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 current_state_ = state; | 54 current_state_ = state; |
| 55 if (state == ACTIVITY_UNLOADED) | 55 if (state == ACTIVITY_UNLOADED) |
| 56 app_activity_registry_->Unload(); | 56 app_activity_registry_->Unload(); |
| 57 } | 57 } |
| 58 ActivityState GetCurrentState() override { return current_state_; } | 58 ActivityState GetCurrentState() override { return current_state_; } |
| 59 bool IsVisible() override { return true; } | 59 bool IsVisible() override { return true; } |
| 60 ActivityMediaState GetMediaState() override { | 60 ActivityMediaState GetMediaState() override { |
| 61 return Activity::ACTIVITY_MEDIA_STATE_NONE; | 61 return Activity::ACTIVITY_MEDIA_STATE_NONE; |
| 62 } | 62 } |
| 63 aura::Window* GetWindow() override { | 63 aura::Window* GetWindow() override { |
| 64 return view_->GetWidget()->GetNativeWindow(); | 64 return view_->GetWidget() ? view_->GetWidget()->GetNativeWindow() : nullptr; |
| 65 } | 65 } |
| 66 | 66 |
| 67 // ActivityViewModel: | 67 // ActivityViewModel: |
| 68 void Init() override {} | 68 void Init() override {} |
| 69 SkColor GetRepresentativeColor() const override { return 0; } | 69 SkColor GetRepresentativeColor() const override { return 0; } |
| 70 base::string16 GetTitle() const override { return title_; } | 70 base::string16 GetTitle() const override { return title_; } |
| 71 bool UsesFrame() const override { return true; } | 71 bool UsesFrame() const override { return true; } |
| 72 views::View* GetContentsView() override { return view_; } | 72 views::View* GetContentsView() override { return view_; } |
| 73 views::Widget* CreateWidget() override { return nullptr; } | |
| 74 gfx::ImageSkia GetOverviewModeImage() override { return gfx::ImageSkia(); } | 73 gfx::ImageSkia GetOverviewModeImage() override { return gfx::ImageSkia(); } |
| 75 | 74 |
| 76 private: | 75 private: |
| 77 // If known the registry which holds all activities for the associated app. | 76 // If known the registry which holds all activities for the associated app. |
| 78 AppActivityRegistry* app_activity_registry_; | 77 AppActivityRegistry* app_activity_registry_; |
| 79 | 78 |
| 80 // The title of the activity. | 79 // The title of the activity. |
| 81 base::string16 title_; | 80 base::string16 title_; |
| 82 | 81 |
| 83 // Our view. | 82 // Our view. |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 // However - the restart in this test framework does not really restart and | 422 // However - the restart in this test framework does not really restart and |
| 424 // all objects should be still there.. | 423 // all objects should be still there.. |
| 425 EXPECT_EQ(1, AppRegistry::Get()->NumberOfApplications()); | 424 EXPECT_EQ(1, AppRegistry::Get()->NumberOfApplications()); |
| 426 EXPECT_TRUE(app_activity_registry->unloaded_activity_proxy()); | 425 EXPECT_TRUE(app_activity_registry->unloaded_activity_proxy()); |
| 427 Activity::Delete(app_activity_registry->unloaded_activity_proxy()); | 426 Activity::Delete(app_activity_registry->unloaded_activity_proxy()); |
| 428 EXPECT_EQ(0, AppRegistry::Get()->NumberOfApplications()); | 427 EXPECT_EQ(0, AppRegistry::Get()->NumberOfApplications()); |
| 429 } | 428 } |
| 430 | 429 |
| 431 } // namespace test | 430 } // namespace test |
| 432 } // namespace athena | 431 } // namespace athena |
| OLD | NEW |