| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/public/browser/desktop_media_id.h" | 5 #include "content/public/browser/desktop_media_id.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 friend struct DefaultSingletonTraits<AuraWindowRegistry>; | 53 friend struct DefaultSingletonTraits<AuraWindowRegistry>; |
| 54 | 54 |
| 55 AuraWindowRegistry() | 55 AuraWindowRegistry() |
| 56 : next_id_(1) { | 56 : next_id_(1) { |
| 57 } | 57 } |
| 58 virtual ~AuraWindowRegistry() {} | 58 virtual ~AuraWindowRegistry() {} |
| 59 | 59 |
| 60 // WindowObserver overrides. | 60 // WindowObserver overrides. |
| 61 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE { | 61 virtual void OnWindowDestroying(aura::Window* window) override { |
| 62 std::map<aura::Window*, int>::iterator it = window_to_id_map_.find(window); | 62 std::map<aura::Window*, int>::iterator it = window_to_id_map_.find(window); |
| 63 DCHECK(it != window_to_id_map_.end()); | 63 DCHECK(it != window_to_id_map_.end()); |
| 64 id_to_window_map_.erase(it->second); | 64 id_to_window_map_.erase(it->second); |
| 65 window_to_id_map_.erase(it); | 65 window_to_id_map_.erase(it); |
| 66 } | 66 } |
| 67 | 67 |
| 68 int next_id_; | 68 int next_id_; |
| 69 std::map<aura::Window*, int> window_to_id_map_; | 69 std::map<aura::Window*, int> window_to_id_map_; |
| 70 std::map<int, aura::Window*> id_to_window_map_; | 70 std::map<int, aura::Window*> id_to_window_map_; |
| 71 | 71 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 } | 143 } |
| 144 DCHECK(!prefix.empty()); | 144 DCHECK(!prefix.empty()); |
| 145 | 145 |
| 146 prefix.append(":"); | 146 prefix.append(":"); |
| 147 prefix.append(base::Int64ToString(id)); | 147 prefix.append(base::Int64ToString(id)); |
| 148 | 148 |
| 149 return prefix; | 149 return prefix; |
| 150 } | 150 } |
| 151 | 151 |
| 152 } // namespace content | 152 } // namespace content |
| OLD | NEW |