| 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 #ifndef CHROME_BROWSER_UI_SEARCH_INSTANT_TAB_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_INSTANT_TAB_H_ |
| 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_TAB_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_TAB_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "chrome/browser/ui/search/instant_page.h" | 10 #include "chrome/browser/ui/search/instant_page.h" |
| 11 | 11 |
| 12 class Profile; | |
| 13 | |
| 14 // InstantTab represents a committed page (i.e. an actual tab on the tab strip) | 12 // InstantTab represents a committed page (i.e. an actual tab on the tab strip) |
| 15 // that supports the Instant API. | 13 // that supports the Instant API. |
| 16 class InstantTab : public InstantPage { | 14 class InstantTab : public InstantPage { |
| 17 public: | 15 public: |
| 18 InstantTab(InstantPage::Delegate* delegate, Profile* profile); | 16 explicit InstantTab(InstantPage::Delegate* delegate); |
| 19 ~InstantTab() override; | 17 ~InstantTab() override; |
| 20 | 18 |
| 21 // Start observing |contents| for messages. Sends a message to determine if | 19 // Start observing |contents| for messages. Sends a message to determine if |
| 22 // the page supports the Instant API. | 20 // the page supports the Instant API. |
| 23 void Init(content::WebContents* contents); | 21 void Init(content::WebContents* contents); |
| 24 | 22 |
| 25 // Logs statistics regarding the NTP. | 23 // Logs statistics regarding the NTP. |
| 26 static void TabDeactivated(content::WebContents* contents); | 24 static void TabDeactivated(content::WebContents* contents); |
| 27 static void MostVisitedItemsChanged(content::WebContents* contents); | 25 static void MostVisitedItemsChanged(content::WebContents* contents); |
| 28 | 26 |
| 29 private: | 27 private: |
| 30 // Overridden from InstantPage: | 28 // Overridden from InstantPage: |
| 31 bool ShouldProcessAboutToNavigateMainFrame() override; | 29 bool ShouldProcessAboutToNavigateMainFrame() override; |
| 32 | 30 |
| 33 DISALLOW_COPY_AND_ASSIGN(InstantTab); | 31 DISALLOW_COPY_AND_ASSIGN(InstantTab); |
| 34 }; | 32 }; |
| 35 | 33 |
| 36 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_TAB_H_ | 34 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_TAB_H_ |
| OLD | NEW |