summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/media/webrtc/window_icon_util_chromeos.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/browser/media/webrtc/window_icon_util_chromeos.cc')
-rw-r--r--chromium/chrome/browser/media/webrtc/window_icon_util_chromeos.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/chromium/chrome/browser/media/webrtc/window_icon_util_chromeos.cc b/chromium/chrome/browser/media/webrtc/window_icon_util_chromeos.cc
new file mode 100644
index 00000000000..4a826a5b573
--- /dev/null
+++ b/chromium/chrome/browser/media/webrtc/window_icon_util_chromeos.cc
@@ -0,0 +1,21 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/media/webrtc/window_icon_util.h"
+
+#include "content/public/browser/desktop_media_id.h"
+#include "ui/aura/client/aura_constants.h"
+#include "ui/aura/window.h"
+
+gfx::ImageSkia GetWindowIcon(content::DesktopMediaID id) {
+ DCHECK_EQ(content::DesktopMediaID::TYPE_WINDOW, id.type);
+ aura::Window* window = content::DesktopMediaID::GetNativeWindowById(id);
+ if (!window)
+ return gfx::ImageSkia();
+
+ gfx::ImageSkia* image = window->GetProperty(aura::client::kWindowIconKey);
+ if (!image)
+ image = window->GetProperty(aura::client::kAppIconKey);
+ return image ? *image : gfx::ImageSkia();
+}