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 #ifndef CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_DELEGATE_H_ 6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_DELEGATE_H_ 7 8 #include <set> 9 #include <string> 10 11 #include "ui/base/window_open_disposition.h" 12 13 namespace content { 14 class WebContents; 15 } 16 17 class GURL; 18 class OmniboxView; 19 20 // Objects implement this interface to get notified about changes in the 21 // SearchTabHelper and to provide necessary functionality. 22 class SearchTabHelperDelegate { 23 public: 24 // Navigates the page to |url| in response to a click event. Usually used 25 // by the page to navigate to privileged destinations (e.g. chrome:// URLs) or 26 // to navigate to URLs that are hidden from the page using Restricted IDs 27 // (rid in the API). 28 // 29 // TODO(kmadhusu): Handle search results page navigations to privileged 30 // destinations in a seperate function. This function should handle only the 31 // new tab page thumbnail click events. 32 virtual void NavigateOnThumbnailClick(const GURL& url, 33 WindowOpenDisposition disposition, 34 content::WebContents* source_contents); 35 36 // Invoked when the |web_contents| no longer supports Instant. 37 virtual void OnWebContentsInstantSupportDisabled( 38 const content::WebContents* web_contents); 39 40 // Returns the OmniboxView or NULL if not available. 41 virtual OmniboxView* GetOmniboxView(); 42 43 // Returns a set containing the canonical URLs of the currently open tabs. 44 virtual std::set<std::string> GetOpenUrls(); 45 46 protected: 47 virtual ~SearchTabHelperDelegate(); 48 }; 49 50 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_DELEGATE_H_ 51