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

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

Issue 2228663003: arc: Add package app list updated event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase2 Created 4 years, 4 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 <vector> 10 #include <vector>
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 mojom::ScaleFactor scale_factor) { 56 mojom::ScaleFactor scale_factor) {
57 icon_requests_.push_back( 57 icon_requests_.push_back(
58 new IconRequest(package_name, activity, scale_factor)); 58 new IconRequest(package_name, activity, scale_factor));
59 } 59 }
60 60
61 void FakeAppInstance::SendRefreshAppList( 61 void FakeAppInstance::SendRefreshAppList(
62 const std::vector<mojom::AppInfo>& apps) { 62 const std::vector<mojom::AppInfo>& apps) {
63 app_host_->OnAppListRefreshed(mojo::Array<mojom::AppInfoPtr>::From(apps)); 63 app_host_->OnAppListRefreshed(mojo::Array<mojom::AppInfoPtr>::From(apps));
64 } 64 }
65 65
66 void FakeAppInstance::SendPackageAppListRefreshed(
67 const mojo::String& package_name,
68 const std::vector<mojom::AppInfo>& apps) {
69 app_host_->OnPackageAppListRefreshed(
70 package_name,
71 mojo::Array<mojom::AppInfoPtr>::From(apps));
72 }
73
66 void FakeAppInstance::SendInstallShortcuts( 74 void FakeAppInstance::SendInstallShortcuts(
67 const std::vector<mojom::ShortcutInfo>& shortcuts) { 75 const std::vector<mojom::ShortcutInfo>& shortcuts) {
68 for (auto& shortcut : shortcuts) { 76 for (auto& shortcut : shortcuts) {
69 app_host_->OnInstallShortcut(shortcut.Clone()); 77 app_host_->OnInstallShortcut(shortcut.Clone());
70 } 78 }
71 } 79 }
72 80
73 void FakeAppInstance::SendInstallShortcut(const mojom::ShortcutInfo& shortcut) { 81 void FakeAppInstance::SendInstallShortcut(const mojom::ShortcutInfo& shortcut) {
74 app_host_->OnInstallShortcut(shortcut.Clone()); 82 app_host_->OnInstallShortcut(shortcut.Clone());
75 } 83 }
76 84
77 void FakeAppInstance::SendAppAdded(const mojom::AppInfo& app) { 85 void FakeAppInstance::SendAppAdded(const mojom::AppInfo& app) {
78 app_host_->OnAppAdded(mojom::AppInfo::From(app)); 86 app_host_->OnAppAddedDeprecated(mojom::AppInfo::From(app));
79 } 87 }
80 88
81 void FakeAppInstance::SendTaskCreated(int32_t taskId, 89 void FakeAppInstance::SendTaskCreated(int32_t taskId,
82 const mojom::AppInfo& app) { 90 const mojom::AppInfo& app) {
83 app_host_->OnTaskCreated(taskId, app.package_name, app.activity, app.name); 91 app_host_->OnTaskCreated(taskId, app.package_name, app.activity, app.name);
84 } 92 }
85 93
86 void FakeAppInstance::SendTaskDestroyed(int32_t taskId) { 94 void FakeAppInstance::SendTaskDestroyed(int32_t taskId) {
87 app_host_->OnTaskDestroyed(taskId); 95 app_host_->OnTaskDestroyed(taskId);
88 } 96 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 236
229 std::string png_data_as_string; 237 std::string png_data_as_string;
230 if (GetFakeIcon(scale_factor, &png_data_as_string)) { 238 if (GetFakeIcon(scale_factor, &png_data_as_string)) {
231 callback.Run(mojo::Array<uint8_t>::From(png_data_as_string)); 239 callback.Run(mojo::Array<uint8_t>::From(png_data_as_string));
232 } 240 }
233 } 241 }
234 242
235 void FakeAppInstance::RemoveCachedIcon(const mojo::String& icon_resource_id) {} 243 void FakeAppInstance::RemoveCachedIcon(const mojo::String& icon_resource_id) {}
236 244
237 } // namespace arc 245 } // 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