| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_NTP_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_INSTANT_NTP_H_ |
| 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_NTP_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_NTP_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "chrome/browser/ui/search/instant_loader.h" | 13 #include "chrome/browser/ui/search/instant_loader.h" |
| 14 #include "chrome/browser/ui/search/instant_page.h" | 14 #include "chrome/browser/ui/search/instant_page.h" |
| 15 | 15 |
| 16 class Profile; | 16 class Profile; |
| 17 | 17 |
| 18 // InstantNTP is used to preload an Instant page that will be swapped in when a | 18 // InstantNTP is used to preload an Instant page that will be swapped in when a |
| 19 // user navigates to a New Tab Page (NTP). The InstantNTP contents are never | 19 // user navigates to a New Tab Page (NTP). The InstantNTP contents are never |
| 20 // shown in an un-committed state. | 20 // shown in an un-committed state. |
| 21 class InstantNTP : public InstantPage, | 21 class InstantNTP : public InstantPage, |
| 22 public InstantLoader::Delegate { | 22 public InstantLoader::Delegate { |
| 23 public: | 23 public: |
| 24 InstantNTP(InstantPage::Delegate* delegate, const std::string& instant_url); | 24 InstantNTP(InstantPage::Delegate* delegate, const std::string& instant_url, |
| 25 bool is_incognito); |
| 25 virtual ~InstantNTP(); | 26 virtual ~InstantNTP(); |
| 26 | 27 |
| 27 // Creates a new WebContents and loads |instant_url_| into it. Uses | 28 // Creates a new WebContents and loads |instant_url_| into it. Uses |
| 28 // |active_tab|, if non-NULL, to initialize the size of the WebContents. | 29 // |active_tab|, if non-NULL, to initialize the size of the WebContents. |
| 29 // |on_stale_callback| will be called when |loader_| determines the page to | 30 // |on_stale_callback| will be called when |loader_| determines the page to |
| 30 // be stale. | 31 // be stale. |
| 31 void InitContents(Profile* profile, | 32 void InitContents(Profile* profile, |
| 32 const content::WebContents* active_tab, | 33 const content::WebContents* active_tab, |
| 33 const base::Closure& on_stale_callback); | 34 const base::Closure& on_stale_callback); |
| 34 | 35 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 50 // Overridden from InstantPage: | 51 // Overridden from InstantPage: |
| 51 virtual bool ShouldProcessRenderViewCreated() OVERRIDE; | 52 virtual bool ShouldProcessRenderViewCreated() OVERRIDE; |
| 52 virtual bool ShouldProcessRenderViewGone() OVERRIDE; | 53 virtual bool ShouldProcessRenderViewGone() OVERRIDE; |
| 53 | 54 |
| 54 InstantLoader loader_; | 55 InstantLoader loader_; |
| 55 | 56 |
| 56 DISALLOW_COPY_AND_ASSIGN(InstantNTP); | 57 DISALLOW_COPY_AND_ASSIGN(InstantNTP); |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_NTP_H_ | 60 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_NTP_H_ |
| OLD | NEW |