summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-28 09:18:59 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-28 09:18:59 +0000
commit5b72ad1ebb4d792a322edd81d785c312b349fc33 (patch)
tree3c0ef430fb22264316b73c0ef0966c8f5b57630d /chrome/common
parent1ec0736284a1cc8c44610900f704b3e681c544b3 (diff)
downloadchromium_src-5b72ad1ebb4d792a322edd81d785c312b349fc33.zip
chromium_src-5b72ad1ebb4d792a322edd81d785c312b349fc33.tar.gz
chromium_src-5b72ad1ebb4d792a322edd81d785c312b349fc33.tar.bz2
Require manifests for native messaging hosts.
Previously native messaging hosts were discovered by looking in the user data directory. That approach is hard to use and is not reliable. Now chrome will look for a host manifest file in a system-specific directory and load that file to find host binary. BUG=142915 TBR=thakis@chromium.org Review URL: https://chromiumcodereview.appspot.com/12285015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185189 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/chrome_switches.cc5
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/common/extensions/docs/examples/extensions/native_messaging/popup.js3
3 files changed, 7 insertions, 2 deletions
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index d3af64d..7ea73b0 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -884,6 +884,11 @@ const char kNaClGdbScript[] = "nacl-gdb-script";
// command line. Useful values might be "valgrind" or "xterm -e gdb --args".
const char kNaClLoaderCmdPrefix[] = "nacl-loader-cmd-prefix";
+// List of native messaging hosts outside of the default location. Used for
+// tests. The value must be comma-separate lists of key-value pairs separated
+// equal sign. E.g. "host1=/path/to/host1/manifest.json,host2=/path/host2.json".
+const char kNativeMessagingHosts[] = "native-messaging-hosts";
+
// Sets the base logging level for the net log. Log 0 logs the most data.
// Intended primarily for use with --log-net-log.
const char kNetLogLevel[] = "net-log-level";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index bb20f7d..432f686 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -241,6 +241,7 @@ extern const char kNaClDebugMask[];
extern const char kNaClGdb[];
extern const char kNaClGdbScript[];
extern const char kNaClLoaderCmdPrefix[];
+extern const char kNativeMessagingHosts[];
extern const char kNetLogLevel[];
extern const char kNoDefaultBrowserCheck[];
extern const char kNoDisplayingInsecureContent[];
diff --git a/chrome/common/extensions/docs/examples/extensions/native_messaging/popup.js b/chrome/common/extensions/docs/examples/extensions/native_messaging/popup.js
index 07c6da4..e674dfb 100644
--- a/chrome/common/extensions/docs/examples/extensions/native_messaging/popup.js
+++ b/chrome/common/extensions/docs/examples/extensions/native_messaging/popup.js
@@ -14,8 +14,7 @@ function gotNativeMessage(message) {
function sendNativeMessage() {
if (!port) {
- app = navigator.platform.match(/win/i) ? 'echo.bat' : 'echo.py';
- port = chrome.extension.connectNative(app);
+ port = chrome.extension.connectNative('com.google.chrome.test.echo');
port.onMessage.addListener(gotNativeMessage);
document.getElementById('input-text').style.display = 'block';
document.getElementById('send-native-message').innerHTML = 'Send Message';