[Audio Player] Cleanup the code along with closure compiler
[chromium-blink-merge.git] / components / omnibox / keyword_extensions_delegate.h
blob08cacafb2e848cdd6f315c5719711e4f0867072c
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.
4 //
5 // KeywordExtensionsDelegate contains the extensions-only logic used by
6 // KeywordProvider.
7 // This file contains the dummy implementation of KeywordExtensionsDelegate,
8 // which does nothing.
10 #ifndef COMPONENTS_OMNIBOX_KEYWORD_EXTENSIONS_DELEGATE_H_
11 #define COMPONENTS_OMNIBOX_KEYWORD_EXTENSIONS_DELEGATE_H_
13 #include <string>
15 #include "base/basictypes.h"
16 #include "base/macros.h"
17 #include "base/strings/string16.h"
19 class AutocompleteInput;
20 class KeywordProvider;
21 class TemplateURL;
23 class KeywordExtensionsDelegate {
24 public:
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
39 // matches.
40 // Returns true if this delegate should stay in extension keyword mode.
41 virtual bool Start(const AutocompleteInput& input,
42 bool minimal_changes,
43 const TemplateURL* template_url,
44 const base::string16& remaining_input);
46 // Tells the extension with |extension_id| that the user typed the omnibox
47 // keyword.
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
52 // the omnibox popup.
53 virtual void MaybeEndExtensionKeywordMode();
55 private:
56 DISALLOW_COPY_AND_ASSIGN(KeywordExtensionsDelegate);
59 #endif // COMPONENTS_OMNIBOX_KEYWORD_EXTENSIONS_DELEGATE_H_