summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/search/search_tab_helper_delegate.h
blob: 8bbbfe274c0274704b77bc3a3a958943cb738800 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright 2014 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_UI_SEARCH_SEARCH_TAB_HELPER_DELEGATE_H_
#define CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_DELEGATE_H_

#include <set>
#include <string>

#include "ui/base/window_open_disposition.h"

namespace content {
class WebContents;
}

class GURL;
class OmniboxView;

// Objects implement this interface to get notified about changes in the
// SearchTabHelper and to provide necessary functionality.
class SearchTabHelperDelegate {
 public:
  // Navigates the page to |url| in response to a click event. Usually used
  // by the page to navigate to privileged destinations (e.g. chrome:// URLs) or
  // to navigate to URLs that are hidden from the page using Restricted IDs
  // (rid in the API).
  //
  // TODO(kmadhusu): Handle search results page navigations to privileged
  // destinations in a seperate function. This function should handle only the
  // new tab page thumbnail click events.
  virtual void NavigateOnThumbnailClick(const GURL& url,
                                        WindowOpenDisposition disposition,
                                        content::WebContents* source_contents);

  // Invoked when the |web_contents| no longer supports Instant.
  virtual void OnWebContentsInstantSupportDisabled(
      const content::WebContents* web_contents);

  // Returns the OmniboxView or NULL if not available.
  virtual OmniboxView* GetOmniboxView();

  // Returns a set containing the canonical URLs of the currently open tabs.
  virtual std::set<std::string> GetOpenUrls();

 protected:
  virtual ~SearchTabHelperDelegate();
};

#endif  // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_DELEGATE_H_