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

Side by Side Diff: components/arc/arc_bridge_service_impl.h

Issue 1495723004: Minimum implementation of ARC clipboard Bridge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the fakes Created 5 years 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 #ifndef COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ 5 #ifndef COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_
6 #define COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ 6 #define COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 // Requests to launch an app. 49 // Requests to launch an app.
50 bool LaunchApp(const std::string& package, 50 bool LaunchApp(const std::string& package,
51 const std::string& activity) override; 51 const std::string& activity) override;
52 52
53 // Requests to load an icon of specific scale_factor. 53 // Requests to load an icon of specific scale_factor.
54 bool RequestAppIcon(const std::string& package, 54 bool RequestAppIcon(const std::string& package,
55 const std::string& activity, 55 const std::string& activity,
56 ScaleFactor scale_factor) override; 56 ScaleFactor scale_factor) override;
57 57
58 // Sends the Chrome clipboard content to Android.
59 bool SendClipboardContentToAndroid(const std::string& text) override;
60
58 private: 61 private:
59 friend class ArcBridgeTest; 62 friend class ArcBridgeTest;
60 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Basic); 63 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Basic);
61 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Prerequisites); 64 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Prerequisites);
62 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, ShutdownMidStartup); 65 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, ShutdownMidStartup);
63 66
64 // If all pre-requisites are true (ARC is available, it has been enabled, and 67 // If all pre-requisites are true (ARC is available, it has been enabled, and
65 // the session has started), and ARC is stopped, start ARC. If ARC is running 68 // the session has started), and ARC is stopped, start ARC. If ARC is running
66 // and the pre-requisites stop being true, stop ARC. 69 // and the pre-requisites stop being true, stop ARC.
67 void PrerequisitesChanged(); 70 void PrerequisitesChanged();
68 71
69 // Stops the running instance. 72 // Stops the running instance.
70 void StopInstance(); 73 void StopInstance();
71 74
72 // Called when the instance has reached a boot phase 75 // Called when the instance has reached a boot phase
73 void OnInstanceBootPhase(InstanceBootPhase phase) override; 76 void OnInstanceBootPhase(InstanceBootPhase phase) override;
74 // Handler for ArcInstanceHostMsg_NotificationPosted message. 77 // Handler for ArcInstanceHostMsg_NotificationPosted message.
75 void OnNotificationPosted(ArcNotificationDataPtr data) override; 78 void OnNotificationPosted(ArcNotificationDataPtr data) override;
76 // Handler for ArcInstanceHostMsg_NotificationRemoved message. 79 // Handler for ArcInstanceHostMsg_NotificationRemoved message.
77 void OnNotificationRemoved(const mojo::String& key) override; 80 void OnNotificationRemoved(const mojo::String& key) override;
78 81
82 // Called when the Android clipboard content is changed. This is
83 // typically fired when a user initiates a "Copy" action.
84 void OnSetClipboardContent(const mojo::String& text);
85
86 // Called when the Android clipboard decides to update its content.
87 // This is triggered when a "Paste" action is fired or an app
88 // or a service tries to retrieve the Android clipboard content.
89 void OnGetClipboardContent();
90
79 // Called whenever ARC sends information about available apps. 91 // Called whenever ARC sends information about available apps.
80 void OnAppListRefreshed(mojo::Array<arc::AppInfoPtr> apps) override; 92 void OnAppListRefreshed(mojo::Array<arc::AppInfoPtr> apps) override;
81 93
82 // Called whenever ARC sends app icon data for specific scale factor. 94 // Called whenever ARC sends app icon data for specific scale factor.
83 void OnAppIcon(const mojo::String& package, 95 void OnAppIcon(const mojo::String& package,
84 const mojo::String& activity, 96 const mojo::String& activity,
85 ScaleFactor scale_factor, 97 ScaleFactor scale_factor,
86 mojo::Array<uint8_t> icon_png_data) override; 98 mojo::Array<uint8_t> icon_png_data) override;
87 99
88 // Called when the instance requests wake lock services 100 // Called when the instance requests wake lock services
(...skipping 18 matching lines...) Expand all
107 119
108 // WeakPtrFactory to use callbacks. 120 // WeakPtrFactory to use callbacks.
109 base::WeakPtrFactory<ArcBridgeServiceImpl> weak_factory_; 121 base::WeakPtrFactory<ArcBridgeServiceImpl> weak_factory_;
110 122
111 DISALLOW_COPY_AND_ASSIGN(ArcBridgeServiceImpl); 123 DISALLOW_COPY_AND_ASSIGN(ArcBridgeServiceImpl);
112 }; 124 };
113 125
114 } // namespace arc 126 } // namespace arc
115 127
116 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ 128 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698