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

Side by Side Diff: components/arc/test/fake_app_instance.cc

Issue 2894443002: arc: Set custom icon in shelf for ARC apps. (Closed)
Patch Set: comments addressed Created 3 years, 7 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 "components/arc/test/fake_app_instance.h" 5 #include "components/arc/test/fake_app_instance.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 void FakeAppInstance::SendTaskCreated(int32_t taskId, 98 void FakeAppInstance::SendTaskCreated(int32_t taskId,
99 const mojom::AppInfo& app, 99 const mojom::AppInfo& app,
100 const std::string& intent) { 100 const std::string& intent) {
101 app_host_->OnTaskCreated(taskId, 101 app_host_->OnTaskCreated(taskId,
102 app.package_name, 102 app.package_name,
103 app.activity, 103 app.activity,
104 app.name, 104 app.name,
105 intent); 105 intent);
106 } 106 }
107 107
108 void FakeAppInstance::SendTaskDescription(int32_t taskId,
109 const std::string& label,
110 const std::string& icon_png_data) {
111 app_host_->OnTaskSetDescription(
112 taskId, label,
113 std::vector<uint8_t>(icon_png_data.begin(), icon_png_data.end()));
114 }
115
108 void FakeAppInstance::SendTaskDestroyed(int32_t taskId) { 116 void FakeAppInstance::SendTaskDestroyed(int32_t taskId) {
109 app_host_->OnTaskDestroyed(taskId); 117 app_host_->OnTaskDestroyed(taskId);
110 } 118 }
111 119
112 bool FakeAppInstance::GenerateAndSendIcon(const mojom::AppInfo& app, 120 bool FakeAppInstance::GenerateAndSendIcon(const mojom::AppInfo& app,
113 mojom::ScaleFactor scale_factor, 121 mojom::ScaleFactor scale_factor,
114 std::string* png_data_as_string) { 122 std::string* png_data_as_string) {
115 if (!GetFakeIcon(scale_factor, png_data_as_string)) { 123 if (!GetFakeIcon(scale_factor, png_data_as_string)) {
116 return false; 124 return false;
117 } 125 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 std::string png_data_as_string; 280 std::string png_data_as_string;
273 if (GetFakeIcon(scale_factor, &png_data_as_string)) { 281 if (GetFakeIcon(scale_factor, &png_data_as_string)) {
274 callback.Run(std::vector<uint8_t>(png_data_as_string.begin(), 282 callback.Run(std::vector<uint8_t>(png_data_as_string.begin(),
275 png_data_as_string.end())); 283 png_data_as_string.end()));
276 } 284 }
277 } 285 }
278 286
279 void FakeAppInstance::RemoveCachedIcon(const std::string& icon_resource_id) {} 287 void FakeAppInstance::RemoveCachedIcon(const std::string& icon_resource_id) {}
280 288
281 } // namespace arc 289 } // namespace arc
OLDNEW
« components/arc/test/fake_app_instance.h ('K') | « components/arc/test/fake_app_instance.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698