1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // KeywordExtensionsDelegate contains the extensions-only logic used by
7 // This file contains the dummy implementation of KeywordExtensionsDelegate,
10 #ifndef CHROME_BROWSER_AUTOCOMPLETE_KEYWORD_EXTENSIONS_DELEGATE_H_
11 #define CHROME_BROWSER_AUTOCOMPLETE_KEYWORD_EXTENSIONS_DELEGATE_H_
15 #include "base/basictypes.h"
16 #include "base/macros.h"
17 #include "base/strings/string16.h"
19 class AutocompleteInput;
20 class KeywordProvider;
23 class KeywordExtensionsDelegate {
25 explicit KeywordExtensionsDelegate(KeywordProvider* provider);
26 virtual ~KeywordExtensionsDelegate();
28 // Increments the input ID used to identify if the suggest results from an
29 // extension are current.
30 virtual void IncrementInputId();
32 // Returns true if an extension is enabled.
33 virtual bool IsEnabledExtension(const std::string& extension_id);
35 // Handles the extensions portion of KeywordProvider::Start().
36 // Depending on |minimal_changes| and whether |input| wants matches
37 // synchronous or not, either updates the KeywordProvider's matches with
38 // the existing suggestions or asks the |template_url|'s extension to provide
40 // Returns true if this delegate should stay in extension keyword mode.
41 virtual bool Start(const AutocompleteInput& input,
43 const TemplateURL* template_url,
44 const base::string16& remaining_input);
46 // Tells the extension with |extension_id| that the user typed the omnibox
48 virtual void EnterExtensionKeywordMode(const std::string& extension_id);
50 // If an extension previously entered extension keyword mode, exits extension
51 // keyword mode. This happens when the user has cleared the keyword or closed
53 virtual void MaybeEndExtensionKeywordMode();
56 DISALLOW_COPY_AND_ASSIGN(KeywordExtensionsDelegate);
59 #endif // CHROME_BROWSER_AUTOCOMPLETE_KEYWORD_EXTENSIONS_DELEGATE_H_