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

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: Rebased to catch arc++ notification cl 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 "base/files/scoped_file.h" 8 #include "base/files/scoped_file.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "components/arc/arc_bridge_service.h" 10 #include "components/arc/arc_bridge_service.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 // Requests to launch an app. 47 // Requests to launch an app.
48 bool LaunchApp(const std::string& package, 48 bool LaunchApp(const std::string& package,
49 const std::string& activity) override; 49 const std::string& activity) override;
50 50
51 // Requests to load an icon of specific scale_factor. 51 // Requests to load an icon of specific scale_factor.
52 bool RequestAppIcon(const std::string& package, 52 bool RequestAppIcon(const std::string& package,
53 const std::string& activity, 53 const std::string& activity,
54 ScaleFactor scale_factor) override; 54 ScaleFactor scale_factor) override;
55 55
56 // Sends the Chrome clipboard content to Android side.
57 bool SendClipboardContentToAndroid(const ClipboardData data);
elijahtaylor1 2015/12/04 20:36:51 should this be passed by reference?
58
56 private: 59 private:
57 friend class ArcBridgeTest; 60 friend class ArcBridgeTest;
58 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Basic); 61 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Basic);
59 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, ShutdownMidStartup); 62 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, ShutdownMidStartup);
60 63
61 // If all pre-requisites are true (ARC is available, it has been enabled, and 64 // If all pre-requisites are true (ARC is available, it has been enabled, and
62 // the session has started), and ARC is stopped, start ARC. If ARC is running 65 // the session has started), and ARC is stopped, start ARC. If ARC is running
63 // and the pre-requisites stop being true, stop ARC. 66 // and the pre-requisites stop being true, stop ARC.
64 void PrerequisitesChanged(); 67 void PrerequisitesChanged();
65 68
(...skipping 11 matching lines...) Expand all
77 80
78 // Finishes connecting after setting socket permissions. 81 // Finishes connecting after setting socket permissions.
79 void SocketConnectAfterSetSocketPermissions(const base::FilePath& socket_path, 82 void SocketConnectAfterSetSocketPermissions(const base::FilePath& socket_path,
80 bool socket_permissions_success); 83 bool socket_permissions_success);
81 84
82 // Stops the running instance. 85 // Stops the running instance.
83 void StopInstance(); 86 void StopInstance();
84 87
85 // Called when the instance has reached a boot phase 88 // Called when the instance has reached a boot phase
86 void OnInstanceBootPhase(InstanceBootPhase phase); 89 void OnInstanceBootPhase(InstanceBootPhase phase);
90
87 // Handler for ArcInstanceHostMsg_NotificationPosted message. 91 // Handler for ArcInstanceHostMsg_NotificationPosted message.
88 void OnNotificationPostedFromAndroid(const ArcNotificationData& data); 92 void OnNotificationPostedFromAndroid(const ArcNotificationData& data);
89 // Handler for ArcInstanceHostMsg_NotificationRemoved message. 93 // Handler for ArcInstanceHostMsg_NotificationRemoved message.
90 void OnNotificationRemovedFromAndroid(const std::string& key); 94 void OnNotificationRemovedFromAndroid(const std::string& key);
91 95
96 // Called whenever the Android clipboard content is changed. This is
97 // typically fired when a user initiates a "Copy" action.
98 void OnSetClipboardContent(const ClipboardData& data);
99
100 // Called whenever the Android clipboard decides to update its content.
101 // This is typical triggered when a "Paste" action is fired or an app
102 // or service tries to retrieve the android clipboard content.
103 void OnGetClipboardContent();
104
92 // Called whenever ARC sends information about available apps. 105 // Called whenever ARC sends information about available apps.
93 void OnAppListRefreshed(const std::vector<arc::AppInfo>& apps); 106 void OnAppListRefreshed(const std::vector<arc::AppInfo>& apps);
94 107
95 // Called whenever ARC sends app icon data for specific scale factor. 108 // Called whenever ARC sends app icon data for specific scale factor.
96 void OnAppIcon(const std::string& package, 109 void OnAppIcon(const std::string& package,
97 const std::string& activity, 110 const std::string& activity,
98 ScaleFactor scale_factor, 111 ScaleFactor scale_factor,
99 const std::vector<uint8_t>& icon_png_data); 112 const std::vector<uint8_t>& icon_png_data);
100 113
101 // IPC::Listener: 114 // IPC::Listener:
(...skipping 14 matching lines...) Expand all
116 129
117 // WeakPtrFactory to use callbacks. 130 // WeakPtrFactory to use callbacks.
118 base::WeakPtrFactory<ArcBridgeServiceImpl> weak_factory_; 131 base::WeakPtrFactory<ArcBridgeServiceImpl> weak_factory_;
119 132
120 DISALLOW_COPY_AND_ASSIGN(ArcBridgeServiceImpl); 133 DISALLOW_COPY_AND_ASSIGN(ArcBridgeServiceImpl);
121 }; 134 };
122 135
123 } // namespace arc 136 } // namespace arc
124 137
125 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ 138 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698