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 #include "chrome/browser/ui/search/instant_tab.h"
      6 
      7 #include "chrome/browser/profiles/profile.h"
      8 #include "chrome/browser/ui/webui/ntp/ntp_user_data_logger.h"
      9 #include "content/public/browser/web_contents.h"
     10 
     11 InstantTab::InstantTab(InstantPage::Delegate* delegate,
     12                        Profile* profile)
     13     : InstantPage(delegate, "", profile, profile->IsOffTheRecord()) {
     14 }
     15 
     16 InstantTab::~InstantTab() {
     17 }
     18 
     19 void InstantTab::Init(content::WebContents* contents) {
     20   SetContents(contents);
     21 }
     22 
     23 // static
     24 void InstantTab::CountMouseover(content::WebContents* contents) {
     25   NTPUserDataLogger* data = NTPUserDataLogger::FromWebContents(contents);
     26   if (data)
     27     data->increment_number_of_mouseovers();
     28 }
     29 
     30 // static
     31 void InstantTab::EmitMouseoverCount(content::WebContents* contents) {
     32   NTPUserDataLogger* data = NTPUserDataLogger::FromWebContents(contents);
     33   if (data)
     34     data->EmitMouseoverCount();
     35 }
     36 
     37 bool InstantTab::ShouldProcessAboutToNavigateMainFrame() {
     38   return true;
     39 }
     40 
     41 bool InstantTab::ShouldProcessFocusOmnibox() {
     42   return true;
     43 }
     44 
     45 bool InstantTab::ShouldProcessNavigateToURL() {
     46   return true;
     47 }
     48 
     49 bool InstantTab::ShouldProcessPasteIntoOmnibox() {
     50   return true;
     51 }
     52 
     53 bool InstantTab::ShouldProcessDeleteMostVisitedItem() {
     54   return true;
     55 }
     56 
     57 bool InstantTab::ShouldProcessUndoMostVisitedDeletion() {
     58   return true;
     59 }
     60 
     61 bool InstantTab::ShouldProcessUndoAllMostVisitedDeletions() {
     62   return true;
     63 }
     64