| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |