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

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: rebase 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
« no previous file with comments | « components/arc/test/fake_app_instance.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
109 int32_t taskId,
110 const std::string& label,
111 const std::string& icon_png_data_as_string) {
112 app_host_->OnTaskDescriptionUpdated(
113 taskId, label,
114 std::vector<uint8_t>(icon_png_data_as_string.begin(),
115 icon_png_data_as_string.end()));
116 }
117
108 void FakeAppInstance::SendTaskDestroyed(int32_t taskId) { 118 void FakeAppInstance::SendTaskDestroyed(int32_t taskId) {
109 app_host_->OnTaskDestroyed(taskId); 119 app_host_->OnTaskDestroyed(taskId);
110 } 120 }
111 121
112 bool FakeAppInstance::GenerateAndSendIcon(const mojom::AppInfo& app, 122 bool FakeAppInstance::GenerateAndSendIcon(const mojom::AppInfo& app,
113 mojom::ScaleFactor scale_factor, 123 mojom::ScaleFactor scale_factor,
114 std::string* png_data_as_string) { 124 std::string* png_data_as_string) {
115 if (!GetFakeIcon(scale_factor, png_data_as_string)) { 125 if (!GetFakeIcon(scale_factor, png_data_as_string)) {
116 return false; 126 return false;
117 } 127 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 std::string png_data_as_string; 282 std::string png_data_as_string;
273 if (GetFakeIcon(scale_factor, &png_data_as_string)) { 283 if (GetFakeIcon(scale_factor, &png_data_as_string)) {
274 callback.Run(std::vector<uint8_t>(png_data_as_string.begin(), 284 callback.Run(std::vector<uint8_t>(png_data_as_string.begin(),
275 png_data_as_string.end())); 285 png_data_as_string.end()));
276 } 286 }
277 } 287 }
278 288
279 void FakeAppInstance::RemoveCachedIcon(const std::string& icon_resource_id) {} 289 void FakeAppInstance::RemoveCachedIcon(const std::string& icon_resource_id) {}
280 290
281 } // namespace arc 291 } // namespace arc
OLDNEW
« no previous file with comments | « 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