Add a minor text member to ui::MenuModel.
[chromium-blink-merge.git] / chrome / browser / ui / omnibox / omnibox_current_page_delegate.h
blob560b2c363d864f59dc35efa12f613265f370eaf9
1 // Copyright 2013 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 #ifndef CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_CURRENT_PAGE_DELEGATE_H_
6 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_CURRENT_PAGE_DELEGATE_H_
8 #include "base/basictypes.h"
9 #include "ui/base/window_open_disposition.h"
11 class GURL;
12 class SessionID;
13 class TemplateURL;
14 struct AutocompleteMatch;
16 namespace content {
17 class NavigationController;
20 // A class that abstracts omnibox functionality that depends on the current
21 // tab/page (e.g., getting information about the current page, retrieving
22 // objects associated with the current tab, or performing operations that rely
23 // on such objects under the hood).
24 class OmniboxCurrentPageDelegate {
25 public:
26 virtual ~OmniboxCurrentPageDelegate() {}
28 // Returns whether there is any associated current page. For example, during
29 // startup or shutdown, the omnibox may exist but have no attached page.
30 virtual bool CurrentPageExists() const = 0;
32 // Returns the URL of the current page.
33 virtual const GURL& GetURL() const = 0;
35 // Returns true if the visible entry is a New Tab Page rendered by Instant.
36 virtual bool IsInstantNTP() const = 0;
38 // Returns true if the committed entry is a search results page.
39 virtual bool IsSearchResultsPage() const = 0;
41 // Returns whether the current page is loading.
42 virtual bool IsLoading() const = 0;
44 // Returns the NavigationController for the current page.
45 virtual content::NavigationController& GetNavigationController() const = 0;
47 // Returns the session ID of the current page.
48 virtual const SessionID& GetSessionID() const = 0;
50 // Checks whether |template_url| is an extension keyword; if so, asks the
51 // ExtensionOmniboxEventRouter to process |match| for it and returns true.
52 // Otherwise returns false.
53 virtual bool ProcessExtensionKeyword(TemplateURL* template_url,
54 const AutocompleteMatch& match,
55 WindowOpenDisposition disposition) = 0;
57 // Notifies the SearchTabHelper, if one exists, of relevant changes to the
58 // omnibox state.
59 virtual void NotifySearchTabHelper(bool user_input_in_progress,
60 bool cancelling) = 0;
62 // Performs prerendering for |match|.
63 virtual void DoPrerender(const AutocompleteMatch& match) = 0;
66 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_CURRENT_PAGE_DELEGATE_H_