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

Unified Diff: chrome/browser/extensions/api/messaging/native_message_host_chromeos.cc

Issue 639233002: Remote assistance on Chrome OS Part IV - It2MeHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/messaging/native_message_host_chromeos.cc
diff --git a/chrome/browser/extensions/api/messaging/native_message_host_chromeos.cc b/chrome/browser/extensions/api/messaging/native_message_host_chromeos.cc
index 512598615acf1a73010407a118121db72bf596b7..f87eb406a2e1f12da720ad6c114d163f59526cef 100644
--- a/chrome/browser/extensions/api/messaging/native_message_host_chromeos.cc
+++ b/chrome/browser/extensions/api/messaging/native_message_host_chromeos.cc
@@ -18,7 +18,9 @@
#include "base/values.h"
#include "chrome/browser/extensions/api/messaging/native_messaging_test_util.h"
#include "extensions/common/constants.h"
+#include "extensions/common/switches.h"
#include "extensions/common/url_pattern.h"
+#include "remoting/host/it2me/it2me_native_messaging_host.h"
#include "ui/gfx/native_widget_types.h"
#include "url/gurl.h"
@@ -90,25 +92,37 @@ struct BuiltInHost {
scoped_ptr<NativeMessageHost>(*create_function)();
};
+scoped_ptr<NativeMessageHost> CreateIt2MeHost() {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableRemoteAssistance)) {
+ return remoting::It2MeNativeMessagingHost::Create();
+ }
+ return nullptr;
+}
+
// If you modify the list of allowed_origins, don't forget to update
// remoting/host/it2me/com.google.chrome.remote_assistance.json.jinja2
// to keep the two lists in sync.
// TODO(kelvinp): Load the native messaging manifest as a resource file into
// chrome and fetch the list of allowed_origins from the manifest.
-/*const char* const kRemotingIt2MeOrigins[] = {
+const char* const kRemotingIt2MeOrigins[] = {
"chrome-extension://ljacajndfccfgnfohlgkdphmbnpkjflk/",
"chrome-extension://gbchcmhmhahfdphkhkmpfmihenigjmpp/",
"chrome-extension://kgngmbheleoaphbjbaiobfdepmghbfah/",
"chrome-extension://odkaodonbgfohohmklejpjiejmcipmib/",
"chrome-extension://dokpleeekgeeiehdhmdkeimnkmoifgdd/",
"chrome-extension://ajoainacpilcemgiakehflpbkbfipojk/",
- "chrome-extension://hmboipgjngjoiaeicfdifdoeacilalgc/"};*/
+ "chrome-extension://hmboipgjngjoiaeicfdifdoeacilalgc/"};
static const BuiltInHost kBuiltInHost[] = {
{"com.google.chrome.test.echo", // ScopedTestNativeMessagingHost::kHostName
kEchoHostOrigins,
arraysize(kEchoHostOrigins),
&EchoHost::Create},
+ {"com.google.chrome.remote_assistance",
+ kRemotingIt2MeOrigins,
+ arraysize(kRemotingIt2MeOrigins),
+ &CreateIt2MeHost},
};
bool MatchesSecurityOrigin(const BuiltInHost& host,

Powered by Google App Engine
This is Rietveld 408576698