| 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/content/app_activity_proxy.h" | 5 #include "athena/content/app_activity_proxy.h" |
| 6 | 6 |
| 7 #include "athena/content/app_activity_registry.h" | 7 #include "athena/content/app_activity_registry.h" |
| 8 #include "athena/wm/public/window_list_provider.h" |
| 9 #include "athena/wm/public/window_manager.h" |
| 8 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| 9 #include "ui/views/view.h" | 11 #include "ui/views/view.h" |
| 10 #include "ui/views/widget/widget.h" | 12 #include "ui/views/widget/widget.h" |
| 11 | 13 |
| 12 namespace athena { | 14 namespace athena { |
| 13 | 15 |
| 14 AppActivityProxy::AppActivityProxy(Activity* replaced_activity, | 16 AppActivityProxy::AppActivityProxy(Activity* replaced_activity, |
| 15 AppActivityRegistry* creator) : | 17 AppActivityRegistry* creator) : |
| 16 app_activity_registry_(creator), | 18 app_activity_registry_(creator), |
| 17 title_(replaced_activity->GetActivityViewModel()->GetTitle()), | 19 title_(replaced_activity->GetActivityViewModel()->GetTitle()), |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // This proxy has never any media playing. | 53 // This proxy has never any media playing. |
| 52 return ACTIVITY_MEDIA_STATE_NONE; | 54 return ACTIVITY_MEDIA_STATE_NONE; |
| 53 } | 55 } |
| 54 | 56 |
| 55 aura::Window* AppActivityProxy::GetWindow() { | 57 aura::Window* AppActivityProxy::GetWindow() { |
| 56 return view_->GetWidget()->GetNativeWindow(); | 58 return view_->GetWidget()->GetNativeWindow(); |
| 57 } | 59 } |
| 58 | 60 |
| 59 void AppActivityProxy::Init() { | 61 void AppActivityProxy::Init() { |
| 60 DCHECK(replaced_activity_); | 62 DCHECK(replaced_activity_); |
| 61 // TODO(skuhne): This should call the WindowListProvider to re-arrange. | 63 WindowListProvider* window_list_provider = |
| 62 // At this point we can move the Activity to its proper Activity location. | 64 WindowManager::GetInstance()->GetWindowListProvider(); |
| 63 aura::Window* relative_window = replaced_activity_->GetWindow(); | 65 window_list_provider->MoveWindowBehindOfReferenceWindow( |
| 64 relative_window->parent()->StackChildBelow(GetWindow(), relative_window); | 66 GetWindow(), replaced_activity_->GetWindow()); |
| 65 // We moved. | 67 // We moved. |
| 66 replaced_activity_ = NULL; | 68 replaced_activity_ = NULL; |
| 67 } | 69 } |
| 68 | 70 |
| 69 SkColor AppActivityProxy::GetRepresentativeColor() const { | 71 SkColor AppActivityProxy::GetRepresentativeColor() const { |
| 70 return color_; | 72 return color_; |
| 71 } | 73 } |
| 72 | 74 |
| 73 base::string16 AppActivityProxy::GetTitle() const { | 75 base::string16 AppActivityProxy::GetTitle() const { |
| 74 return title_; | 76 return title_; |
| 75 } | 77 } |
| 76 | 78 |
| 77 bool AppActivityProxy::UsesFrame() const { | 79 bool AppActivityProxy::UsesFrame() const { |
| 78 return true; | 80 return true; |
| 79 } | 81 } |
| 80 | 82 |
| 81 views::View* AppActivityProxy::GetContentsView() { | 83 views::View* AppActivityProxy::GetContentsView() { |
| 82 return view_; | 84 return view_; |
| 83 } | 85 } |
| 84 | 86 |
| 85 void AppActivityProxy::CreateOverviewModeImage() { | 87 void AppActivityProxy::CreateOverviewModeImage() { |
| 86 // Nothing we can do here. | 88 // Nothing we can do here. |
| 87 } | 89 } |
| 88 | 90 |
| 89 gfx::ImageSkia AppActivityProxy::GetOverviewModeImage() { | 91 gfx::ImageSkia AppActivityProxy::GetOverviewModeImage() { |
| 90 return image_; | 92 return image_; |
| 91 } | 93 } |
| 92 | 94 |
| 93 } // namespace athena | 95 } // namespace athena |
| OLD | NEW |