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->StackWindowBehindTo(GetWindow(), |
64 relative_window->parent()->StackChildBelow(GetWindow(), relative_window); | 66 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_; |
(...skipping 15 matching lines...) Expand all Loading... |
90 return image_; | 92 return image_; |
91 } | 93 } |
92 | 94 |
93 void AppActivityProxy::PrepareContentsForOverview() { | 95 void AppActivityProxy::PrepareContentsForOverview() { |
94 } | 96 } |
95 | 97 |
96 void AppActivityProxy::ResetContentsView() { | 98 void AppActivityProxy::ResetContentsView() { |
97 } | 99 } |
98 | 100 |
99 } // namespace athena | 101 } // namespace athena |
OLD | NEW |