Home | History | Annotate | Download | only in search
      1 // Copyright 2012 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_INSTANT_TAB_H_
      6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_TAB_H_
      7 
      8 #include "base/basictypes.h"
      9 #include "base/compiler_specific.h"
     10 #include "chrome/browser/ui/search/instant_page.h"
     11 
     12 class Profile;
     13 
     14 // InstantTab represents a committed page (i.e. an actual tab on the tab strip)
     15 // that supports the Instant API.
     16 class InstantTab : public InstantPage {
     17  public:
     18   InstantTab(InstantPage::Delegate* delegate, Profile* profile);
     19   virtual ~InstantTab();
     20 
     21   // Start observing |contents| for messages. Sends a message to determine if
     22   // the page supports the Instant API.
     23   void Init(content::WebContents* contents);
     24 
     25   // Used to log each time the user mouses over NTP tiles or titles.
     26   static void CountMouseover(content::WebContents* contents);
     27 
     28   // Used to log in UMA the total number of mouseovers over NTP tiles/titles.
     29   static void EmitMouseoverCount(content::WebContents* contents);
     30 
     31  private:
     32   // Overridden from InstantPage:
     33   virtual bool ShouldProcessAboutToNavigateMainFrame() OVERRIDE;
     34   virtual bool ShouldProcessFocusOmnibox() OVERRIDE;
     35   virtual bool ShouldProcessNavigateToURL() OVERRIDE;
     36   virtual bool ShouldProcessPasteIntoOmnibox() OVERRIDE;
     37   virtual bool ShouldProcessDeleteMostVisitedItem() OVERRIDE;
     38   virtual bool ShouldProcessUndoMostVisitedDeletion() OVERRIDE;
     39   virtual bool ShouldProcessUndoAllMostVisitedDeletions() OVERRIDE;
     40 
     41   DISALLOW_COPY_AND_ASSIGN(InstantTab);
     42 };
     43 
     44 #endif  // CHROME_BROWSER_UI_SEARCH_INSTANT_TAB_H_
     45