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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 // static | 92 // static |
93 aura::Window* DesktopMediaID::GetAuraWindowById(const DesktopMediaID& id) { | 93 aura::Window* DesktopMediaID::GetAuraWindowById(const DesktopMediaID& id) { |
94 return AuraWindowRegistry::GetInstance()->GetWindowById(id.aura_id); | 94 return AuraWindowRegistry::GetInstance()->GetWindowById(id.aura_id); |
95 } | 95 } |
96 | 96 |
97 #endif // defined(USE_AURA) | 97 #endif // defined(USE_AURA) |
98 | 98 |
99 bool DesktopMediaID::operator<(const DesktopMediaID& other) const { | 99 bool DesktopMediaID::operator<(const DesktopMediaID& other) const { |
100 #if defined(USE_AURA) | 100 #if defined(USE_AURA) |
101 return std::tie(type, id, aura_id, web_contents_id) < | 101 return std::tie(type, id, aura_id, web_contents_id, audio_share) < |
102 std::tie(other.type, other.id, other.aura_id, other.web_contents_id); | 102 std::tie(other.type, other.id, other.aura_id, other.web_contents_id, |
| 103 other.audio_share); |
103 #else | 104 #else |
104 return std::tie(type, id, web_contents_id) < | 105 return std::tie(type, id, web_contents_id, audio_share) < |
105 std::tie(other.type, other.id, other.web_contents_id); | 106 std::tie(other.type, other.id, other.web_contents_id, |
| 107 other.audio_share); |
106 #endif | 108 #endif |
107 } | 109 } |
108 | 110 |
109 bool DesktopMediaID::operator==(const DesktopMediaID& other) const { | 111 bool DesktopMediaID::operator==(const DesktopMediaID& other) const { |
110 #if defined(USE_AURA) | 112 #if defined(USE_AURA) |
111 return type == other.type && id == other.id && aura_id == other.aura_id && | 113 return type == other.type && id == other.id && aura_id == other.aura_id && |
112 web_contents_id == other.web_contents_id; | 114 web_contents_id == other.web_contents_id && |
| 115 audio_share == other.audio_share; |
113 #else | 116 #else |
114 return type == other.type && id == other.id && | 117 return type == other.type && id == other.id && |
115 web_contents_id == other.web_contents_id; | 118 web_contents_id == other.web_contents_id && |
| 119 audio_share == other.audio_share; |
116 #endif | 120 #endif |
117 } | 121 } |
118 | 122 |
119 // static | 123 // static |
120 // Input string should in format: | 124 // Input string should in format: |
121 // for WebContents: | 125 // for WebContents: |
122 // web-contents-media-stream://"render_process_id":"render_process_id" | 126 // web-contents-media-stream://"render_process_id":"render_process_id" |
123 // for no aura screen and window: screen:"window_id" or window:"window_id" | 127 // for no aura screen and window: screen:"window_id" or window:"window_id" |
124 // for aura screen and window: screen:"window_id:aura_id" or | 128 // for aura screen and window: screen:"window_id:aura_id" or |
125 // window:"window_id:aura_id". | 129 // window:"window_id:aura_id". |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 194 |
191 #if defined(USE_AURA) | 195 #if defined(USE_AURA) |
192 prefix.append(":"); | 196 prefix.append(":"); |
193 prefix.append(base::Int64ToString(aura_id)); | 197 prefix.append(base::Int64ToString(aura_id)); |
194 #endif // defined(USE_AURA) | 198 #endif // defined(USE_AURA) |
195 | 199 |
196 return prefix; | 200 return prefix; |
197 } | 201 } |
198 | 202 |
199 } // namespace content | 203 } // namespace content |
OLD | NEW |