| 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_view_manager.h" | 5 #include "athena/activity/public/activity_view_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "athena/activity/activity_widget_delegate.h" | 10 #include "athena/activity/activity_widget_delegate.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 if (find != activity_widgets_.end()) { | 67 if (find != activity_widgets_.end()) { |
| 68 views::Widget* widget = find->second; | 68 views::Widget* widget = find->second; |
| 69 widget->RemoveObserver(this); | 69 widget->RemoveObserver(this); |
| 70 widget->Close(); | 70 widget->Close(); |
| 71 activity_widgets_.erase(activity); | 71 activity_widgets_.erase(activity); |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 | 74 |
| 75 virtual void UpdateActivity(Activity* activity) OVERRIDE { | 75 virtual void UpdateActivity(Activity* activity) OVERRIDE { |
| 76 ActivityWidgetMap::iterator find = activity_widgets_.find(activity); | 76 ActivityWidgetMap::iterator find = activity_widgets_.find(activity); |
| 77 if (find != activity_widgets_.end()) | 77 if (find != activity_widgets_.end()) { |
| 78 find->second->UpdateWindowIcon(); |
| 78 find->second->UpdateWindowTitle(); | 79 find->second->UpdateWindowTitle(); |
| 80 } |
| 79 } | 81 } |
| 80 | 82 |
| 81 // views::WidgetObserver: | 83 // views::WidgetObserver: |
| 82 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE { | 84 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE { |
| 83 for (ActivityWidgetMap::iterator iter = activity_widgets_.begin(); | 85 for (ActivityWidgetMap::iterator iter = activity_widgets_.begin(); |
| 84 iter != activity_widgets_.end(); | 86 iter != activity_widgets_.end(); |
| 85 ++iter) { | 87 ++iter) { |
| 86 if (iter->second == widget) { | 88 if (iter->second == widget) { |
| 87 Activity::Delete(iter->first); | 89 Activity::Delete(iter->first); |
| 88 break; | 90 break; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 108 ActivityViewManager* ActivityViewManager::Get() { | 110 ActivityViewManager* ActivityViewManager::Get() { |
| 109 return instance; | 111 return instance; |
| 110 } | 112 } |
| 111 | 113 |
| 112 void ActivityViewManager::Shutdown() { | 114 void ActivityViewManager::Shutdown() { |
| 113 CHECK(instance); | 115 CHECK(instance); |
| 114 delete instance; | 116 delete instance; |
| 115 } | 117 } |
| 116 | 118 |
| 117 } // namespace athena | 119 } // namespace athena |
| OLD | NEW |