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_BROWSER_INSTANT_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/prefs/public/pref_change_registrar.h" | 10 #include "base/prefs/public/pref_change_registrar.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 class BrowserInstantController : public content::NotificationObserver, | 35 class BrowserInstantController : public content::NotificationObserver, |
36 public search::SearchModelObserver { | 36 public search::SearchModelObserver { |
37 public: | 37 public: |
38 explicit BrowserInstantController(Browser* browser); | 38 explicit BrowserInstantController(Browser* browser); |
39 virtual ~BrowserInstantController(); | 39 virtual ~BrowserInstantController(); |
40 | 40 |
41 // Returns true if Instant is enabled in a visible, preview-showing mode. | 41 // Returns true if Instant is enabled in a visible, preview-showing mode. |
42 static bool IsInstantEnabled(Profile* profile); | 42 static bool IsInstantEnabled(Profile* profile); |
43 | 43 |
44 // Registers Instant related preferences. | 44 // Registers Instant related preferences. |
45 static void RegisterUserPrefs(PrefService* prefs, | 45 static void RegisterUserPrefs(PrefRegistrySyncable* registry); |
46 PrefRegistrySyncable* registry); | |
47 | 46 |
48 // If |url| is the new tab page URL, set |target_contents| to the preloaded | 47 // If |url| is the new tab page URL, set |target_contents| to the preloaded |
49 // NTP contents from InstantController. If |source_contents| is not NULL, we | 48 // NTP contents from InstantController. If |source_contents| is not NULL, we |
50 // replace it with the new |target_contents| in the tabstrip and delete | 49 // replace it with the new |target_contents| in the tabstrip and delete |
51 // |source_contents|. Otherwise, the caller owns |target_contents| and is | 50 // |source_contents|. Otherwise, the caller owns |target_contents| and is |
52 // responsible for inserting it into the tabstrip. | 51 // responsible for inserting it into the tabstrip. |
53 // | 52 // |
54 // Returns true if and only if we update |target_contents|. | 53 // Returns true if and only if we update |target_contents|. |
55 bool MaybeSwapInInstantNTPContents( | 54 bool MaybeSwapInInstantNTPContents( |
56 const GURL& url, | 55 const GURL& url, |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 PrefChangeRegistrar profile_pref_registrar_; | 139 PrefChangeRegistrar profile_pref_registrar_; |
141 | 140 |
142 content::NotificationRegistrar registrar_; | 141 content::NotificationRegistrar registrar_; |
143 | 142 |
144 DISALLOW_COPY_AND_ASSIGN(BrowserInstantController); | 143 DISALLOW_COPY_AND_ASSIGN(BrowserInstantController); |
145 }; | 144 }; |
146 | 145 |
147 } // namespace chrome | 146 } // namespace chrome |
148 | 147 |
149 #endif // CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ | 148 #endif // CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ |
OLD | NEW |