| 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 <vector> | 10 #include <vector> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 const std::vector<mojom::ShortcutInfo>& shortcuts) { | 67 const std::vector<mojom::ShortcutInfo>& shortcuts) { |
| 68 for (auto& shortcut : shortcuts) { | 68 for (auto& shortcut : shortcuts) { |
| 69 app_host_->OnInstallShortcut(shortcut.Clone()); | 69 app_host_->OnInstallShortcut(shortcut.Clone()); |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 void FakeAppInstance::SendInstallShortcut(const mojom::ShortcutInfo& shortcut) { | 73 void FakeAppInstance::SendInstallShortcut(const mojom::ShortcutInfo& shortcut) { |
| 74 app_host_->OnInstallShortcut(shortcut.Clone()); | 74 app_host_->OnInstallShortcut(shortcut.Clone()); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void FakeAppInstance::SendAppAdded(const mojom::AppInfo& app) { |
| 78 app_host_->OnAppAdded(mojom::AppInfo::From(app)); |
| 79 } |
| 80 |
| 77 void FakeAppInstance::SendTaskCreated(int32_t taskId, | 81 void FakeAppInstance::SendTaskCreated(int32_t taskId, |
| 78 const mojom::AppInfo& app) { | 82 const mojom::AppInfo& app) { |
| 79 app_host_->OnTaskCreated(taskId, app.package_name, app.activity); | 83 app_host_->OnTaskCreated(taskId, app.package_name, app.activity, app.name); |
| 80 } | 84 } |
| 81 | 85 |
| 82 void FakeAppInstance::SendTaskDestroyed(int32_t taskId) { | 86 void FakeAppInstance::SendTaskDestroyed(int32_t taskId) { |
| 83 app_host_->OnTaskDestroyed(taskId); | 87 app_host_->OnTaskDestroyed(taskId); |
| 84 } | 88 } |
| 85 | 89 |
| 86 bool FakeAppInstance::GenerateAndSendIcon(const mojom::AppInfo& app, | 90 bool FakeAppInstance::GenerateAndSendIcon(const mojom::AppInfo& app, |
| 87 mojom::ScaleFactor scale_factor, | 91 mojom::ScaleFactor scale_factor, |
| 88 std::string* png_data_as_string) { | 92 std::string* png_data_as_string) { |
| 89 if (!GetFakeIcon(scale_factor, png_data_as_string)) { | 93 if (!GetFakeIcon(scale_factor, png_data_as_string)) { |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 246 |
| 243 std::string png_data_as_string; | 247 std::string png_data_as_string; |
| 244 if (GetFakeIcon(scale_factor, &png_data_as_string)) { | 248 if (GetFakeIcon(scale_factor, &png_data_as_string)) { |
| 245 callback.Run(mojo::Array<uint8_t>::From(png_data_as_string)); | 249 callback.Run(mojo::Array<uint8_t>::From(png_data_as_string)); |
| 246 } | 250 } |
| 247 } | 251 } |
| 248 | 252 |
| 249 void FakeAppInstance::RemoveCachedIcon(const mojo::String& icon_resource_id) {} | 253 void FakeAppInstance::RemoveCachedIcon(const mojo::String& icon_resource_id) {} |
| 250 | 254 |
| 251 } // namespace arc | 255 } // namespace arc |
| OLD | NEW |