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/id_map.h" | 9 #include "base/id_map.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 aura::Window* DesktopMediaID::GetAuraWindowById(const DesktopMediaID& id) { | 90 aura::Window* DesktopMediaID::GetAuraWindowById(const DesktopMediaID& id) { |
91 return AuraWindowRegistry::GetInstance()->GetWindowById(id.aura_id); | 91 return AuraWindowRegistry::GetInstance()->GetWindowById(id.aura_id); |
92 } | 92 } |
93 | 93 |
94 #endif // defined(USE_AURA) | 94 #endif // defined(USE_AURA) |
95 | 95 |
96 DesktopMediaID::DesktopMediaID() = default; | 96 DesktopMediaID::DesktopMediaID() = default; |
97 | 97 |
98 // static | 98 // static |
99 DesktopMediaID DesktopMediaID::Parse(const std::string& str) { | 99 DesktopMediaID DesktopMediaID::Parse(const std::string& str) { |
100 std::vector<std::string> parts; | 100 std::vector<std::string> parts = base::SplitString( |
101 base::SplitString(str, ':', &parts); | 101 str, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
102 | 102 |
103 #if defined(USE_AURA) | 103 #if defined(USE_AURA) |
104 if (parts.size() != 3) | 104 if (parts.size() != 3) |
105 return DesktopMediaID(); | 105 return DesktopMediaID(); |
106 #else | 106 #else |
107 if (parts.size() != 2) | 107 if (parts.size() != 2) |
108 return DesktopMediaID(); | 108 return DesktopMediaID(); |
109 #endif | 109 #endif |
110 | 110 |
111 Type type = TYPE_NONE; | 111 Type type = TYPE_NONE; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 #if defined(USE_AURA) | 154 #if defined(USE_AURA) |
155 prefix.append(":"); | 155 prefix.append(":"); |
156 prefix.append(base::Int64ToString(aura_id)); | 156 prefix.append(base::Int64ToString(aura_id)); |
157 #endif // defined(USE_AURA) | 157 #endif // defined(USE_AURA) |
158 | 158 |
159 return prefix; | 159 return prefix; |
160 } | 160 } |
161 | 161 |
162 } // namespace content | 162 } // namespace content |
OLD | NEW |