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

Unified Diff: chrome/browser/extensions/extension_omnibox_api.h

Issue 2078021: First pass at experimental omnibox API. There are plenty of rough edges and (Closed)
Patch Set: no prefer_keyword Created 10 years, 7 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/extension_omnibox_api.h
diff --git a/chrome/browser/extensions/extension_omnibox_api.h b/chrome/browser/extensions/extension_omnibox_api.h
new file mode 100644
index 0000000000000000000000000000000000000000..f77e904b39e0a77ff19d5235107b0b45dada2b78
--- /dev/null
+++ b/chrome/browser/extensions/extension_omnibox_api.h
@@ -0,0 +1,39 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_OMNIBOX_API_H_
+#define CHROME_BROWSER_EXTENSIONS_EXTENSION_OMNIBOX_API_H_
+
+#include "chrome/browser/extensions/extension_function.h"
+
+class ListValue;
+
+// Event router class for events related to the omnibox API.
+class ExtensionOmniboxEventRouter {
+ public:
+ // The user has changed what is typed into the omnibox while in an extension
+ // keyword session. Returns true if someone is listening to this event, and
+ // thus we have some degree of confidence we'll get a response.
+ static bool OnInputChanged(
+ Profile* profile, const std::string& extension_id,
+ const std::string& input, int suggest_id);
+
+ // The user has accepted the omnibox input.
+ static void OnInputEntered(
+ Profile* profile, const std::string& extension_id,
+ const std::string& input);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ExtensionOmniboxEventRouter);
+};
+
+class OmniboxSendSuggestionsFunction : public SyncExtensionFunction {
+ public:
+ virtual bool RunImpl();
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.omnibox.sendSuggestions");
+};
+
+typedef std::pair<int, ListValue*> ExtensionOmniboxSuggestions;
+
+#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_OMNIBOX_API_H_
« no previous file with comments | « chrome/browser/extensions/extension_message_service.cc ('k') | chrome/browser/extensions/extension_omnibox_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698