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

Side by Side Diff: chrome/browser/extensions/api/omnibox/omnibox_api.h

Issue 10535155: Hook the activeTab permission up to the omnibox, page action, and context menu APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/string16.h" 13 #include "base/string16.h"
14 #include "chrome/browser/autocomplete/autocomplete_match.h" 14 #include "chrome/browser/autocomplete/autocomplete_match.h"
15 #include "chrome/browser/extensions/extension_function.h" 15 #include "chrome/browser/extensions/extension_function.h"
16 16
17 class TabContents;
17 class TemplateURL; 18 class TemplateURL;
18 namespace base { 19 namespace base {
19 class ListValue; 20 class ListValue;
20 } 21 }
21 22
22 namespace extensions { 23 namespace extensions {
23 24
24 // Event router class for events related to the omnibox API. 25 // Event router class for events related to the omnibox API.
25 class ExtensionOmniboxEventRouter { 26 class ExtensionOmniboxEventRouter {
26 public: 27 public:
27 // The user has just typed the omnibox keyword. This is sent exactly once in 28 // The user has just typed the omnibox keyword. This is sent exactly once in
28 // a given input session, before any OnInputChanged events. 29 // a given input session, before any OnInputChanged events.
29 static void OnInputStarted( 30 static void OnInputStarted(
30 Profile* profile, const std::string& extension_id); 31 Profile* profile, const std::string& extension_id);
31 32
32 // The user has changed what is typed into the omnibox while in an extension 33 // The user has changed what is typed into the omnibox while in an extension
33 // keyword session. Returns true if someone is listening to this event, and 34 // keyword session. Returns true if someone is listening to this event, and
34 // thus we have some degree of confidence we'll get a response. 35 // thus we have some degree of confidence we'll get a response.
35 static bool OnInputChanged( 36 static bool OnInputChanged(
36 Profile* profile, const std::string& extension_id, 37 Profile* profile,
38 const std::string& extension_id,
37 const std::string& input, int suggest_id); 39 const std::string& input, int suggest_id);
38 40
39 // The user has accepted the omnibox input. 41 // The user has accepted the omnibox input.
40 static void OnInputEntered( 42 static void OnInputEntered(
41 Profile* profile, const std::string& extension_id, 43 TabContents* tab_contents,
44 const std::string& extension_id,
42 const std::string& input); 45 const std::string& input);
43 46
44 // The user has cleared the keyword, or closed the omnibox popup. This is 47 // The user has cleared the keyword, or closed the omnibox popup. This is
45 // sent at most once in a give input session, after any OnInputChanged events. 48 // sent at most once in a give input session, after any OnInputChanged events.
46 static void OnInputCancelled( 49 static void OnInputCancelled(
47 Profile* profile, const std::string& extension_id); 50 Profile* profile, const std::string& extension_id);
48 51
49 private: 52 private:
50 DISALLOW_COPY_AND_ASSIGN(ExtensionOmniboxEventRouter); 53 DISALLOW_COPY_AND_ASSIGN(ExtensionOmniboxEventRouter);
51 }; 54 };
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // omnibox.setDefaultSuggestion, apply that to |match|. Otherwise, do nothing. 117 // omnibox.setDefaultSuggestion, apply that to |match|. Otherwise, do nothing.
115 void ApplyDefaultSuggestionForExtensionKeyword( 118 void ApplyDefaultSuggestionForExtensionKeyword(
116 Profile* profile, 119 Profile* profile,
117 const TemplateURL* keyword, 120 const TemplateURL* keyword,
118 const string16& remaining_input, 121 const string16& remaining_input,
119 AutocompleteMatch* match); 122 AutocompleteMatch* match);
120 123
121 } // namespace extensions 124 } // namespace extensions
122 125
123 #endif // CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ 126 #endif // CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/active_tab_permission_manager.cc ('k') | chrome/browser/extensions/api/omnibox/omnibox_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698