Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: mash/wm/property_util.cc

Issue 1899323002: Add mash shelf application id support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "mash/wm/property_util.h" 5 #include "mash/wm/property_util.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "components/mus/public/cpp/property_type_converters.h" 9 #include "components/mus/public/cpp/property_type_converters.h"
10 #include "components/mus/public/cpp/window_property.h" 10 #include "components/mus/public/cpp/window_property.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 mojo::Array<uint8_t> GetWindowAppIcon(const mus::Window* window) { 142 mojo::Array<uint8_t> GetWindowAppIcon(const mus::Window* window) {
143 if (window->HasSharedProperty( 143 if (window->HasSharedProperty(
144 mus::mojom::WindowManager::kWindowAppIcon_Property)) { 144 mus::mojom::WindowManager::kWindowAppIcon_Property)) {
145 return mojo::Array<uint8_t>::From( 145 return mojo::Array<uint8_t>::From(
146 window->GetSharedProperty<std::vector<uint8_t>>( 146 window->GetSharedProperty<std::vector<uint8_t>>(
147 mus::mojom::WindowManager::kWindowAppIcon_Property)); 147 mus::mojom::WindowManager::kWindowAppIcon_Property));
148 } 148 }
149 return mojo::Array<uint8_t>(); 149 return mojo::Array<uint8_t>();
150 } 150 }
151 151
152 void SetAppID(mus::Window* window, const base::string16& app_id) {
153 window->SetSharedProperty<base::string16>(
154 mus::mojom::WindowManager::kAppID_Property, app_id);
155 }
156
157 base::string16 GetAppID(const mus::Window* window) {
158 if (!window->HasSharedProperty(mus::mojom::WindowManager::kAppID_Property))
159 return base::string16();
160
161 return window->GetSharedProperty<base::string16>(
162 mus::mojom::WindowManager::kAppID_Property);
163 }
164
152 } // namespace wm 165 } // namespace wm
153 } // namespace mash 166 } // namespace mash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698