Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Side by Side Diff: athena/activity/activity_manager_impl.cc

Issue 694413005: athena: Introduce ActivityView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « athena/activity/activity_manager_impl.h ('k') | athena/activity/activity_widget_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/activity_manager_impl.h" 5 #include "athena/activity/activity_manager_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "athena/activity/activity_widget_delegate.h" 9 #include "athena/activity/activity_widget_delegate.h"
10 #include "athena/activity/public/activity.h" 10 #include "athena/activity/public/activity.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 if (find != activities_.end()) { 84 if (find != activities_.end()) {
85 FOR_EACH_OBSERVER( 85 FOR_EACH_OBSERVER(
86 ActivityManagerObserver, observers_, OnActivityEnding(activity)); 86 ActivityManagerObserver, observers_, OnActivityEnding(activity));
87 activities_.erase(find); 87 activities_.erase(find);
88 views::Widget* widget = GetWidget(activity); 88 views::Widget* widget = GetWidget(activity);
89 widget->GetNativeView()->RemoveObserver(this); 89 widget->GetNativeView()->RemoveObserver(this);
90 widget->Close(); 90 widget->Close();
91 } 91 }
92 } 92 }
93 93
94 void ActivityManagerImpl::UpdateActivity(Activity* activity) {
95 views::Widget* widget = GetWidget(activity);
96 widget->UpdateWindowIcon();
97 widget->UpdateWindowTitle();
98 }
99
100 const ActivityList& ActivityManagerImpl::GetActivityList() { 94 const ActivityList& ActivityManagerImpl::GetActivityList() {
101 return activities_; 95 return activities_;
102 } 96 }
103 97
104 Activity* ActivityManagerImpl::GetActivityForWindow(aura::Window* window) { 98 Activity* ActivityManagerImpl::GetActivityForWindow(aura::Window* window) {
105 struct Matcher { 99 struct Matcher {
106 Matcher(aura::Window* w) : window(w) {} 100 Matcher(aura::Window* w) : window(w) {}
107 bool operator()(Activity* activity) { 101 bool operator()(Activity* activity) {
108 return activity->GetWindow() == window; 102 return activity->GetWindow() == window;
109 } 103 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 return instance; 154 return instance;
161 } 155 }
162 156
163 void ActivityManager::Shutdown() { 157 void ActivityManager::Shutdown() {
164 CHECK(instance); 158 CHECK(instance);
165 delete instance; 159 delete instance;
166 } 160 }
167 161
168 162
169 } // namespace athena 163 } // namespace athena
OLDNEW
« no previous file with comments | « athena/activity/activity_manager_impl.h ('k') | athena/activity/activity_widget_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698