OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/search/instant_tab.h" | 5 #include "chrome/browser/ui/search/instant_tab.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | |
8 #include "chrome/browser/ui/webui/ntp/ntp_user_data_logger.h" | 7 #include "chrome/browser/ui/webui/ntp/ntp_user_data_logger.h" |
9 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" |
10 | 9 |
11 InstantTab::InstantTab(InstantPage::Delegate* delegate, | 10 InstantTab::InstantTab(InstantPage::Delegate* delegate) |
12 Profile* profile) | 11 : InstantPage(delegate) { |
13 : InstantPage(delegate, "", profile) { | |
14 } | 12 } |
15 | 13 |
16 InstantTab::~InstantTab() { | 14 InstantTab::~InstantTab() { |
17 } | 15 } |
18 | 16 |
19 void InstantTab::Init(content::WebContents* contents) { | 17 void InstantTab::Init(content::WebContents* contents) { |
20 SetContents(contents); | 18 SetContents(contents); |
21 } | 19 } |
22 | 20 |
23 // static | 21 // static |
24 void InstantTab::TabDeactivated(content::WebContents* contents) { | 22 void InstantTab::TabDeactivated(content::WebContents* contents) { |
25 NTPUserDataLogger::GetOrCreateFromWebContents(contents)->TabDeactivated(); | 23 NTPUserDataLogger::GetOrCreateFromWebContents(contents)->TabDeactivated(); |
26 } | 24 } |
27 | 25 |
28 // static | 26 // static |
29 void InstantTab::MostVisitedItemsChanged(content::WebContents* contents) { | 27 void InstantTab::MostVisitedItemsChanged(content::WebContents* contents) { |
30 NTPUserDataLogger::GetOrCreateFromWebContents(contents) | 28 NTPUserDataLogger::GetOrCreateFromWebContents(contents) |
31 ->MostVisitedItemsChanged(); | 29 ->MostVisitedItemsChanged(); |
32 } | 30 } |
33 | 31 |
34 bool InstantTab::ShouldProcessAboutToNavigateMainFrame() { | 32 bool InstantTab::ShouldProcessAboutToNavigateMainFrame() { |
35 return true; | 33 return true; |
36 } | 34 } |
OLD | NEW |