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" |
11 #include "chrome/browser/instant/instant_controller.h" | 11 #include "chrome/browser/instant/instant_controller.h" |
12 #include "chrome/browser/instant/instant_unload_handler.h" | 12 #include "chrome/browser/instant/instant_unload_handler.h" |
13 #include "chrome/browser/ui/search/search_model_observer.h" | 13 #include "chrome/browser/ui/search/search_model_observer.h" |
14 #include "content/public/browser/notification_observer.h" | 14 #include "content/public/browser/notification_observer.h" |
15 #include "content/public/browser/notification_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" |
16 #include "webkit/glue/window_open_disposition.h" | 16 #include "webkit/glue/window_open_disposition.h" |
17 | 17 |
18 class Browser; | 18 class Browser; |
19 struct InstantSuggestion; | 19 struct InstantSuggestion; |
20 class PrefService; | 20 class PrefServiceSyncable; |
21 class Profile; | 21 class Profile; |
22 class ThemeService; | 22 class ThemeService; |
23 | 23 |
24 namespace content { | 24 namespace content { |
25 class WebContents; | 25 class WebContents; |
26 } | 26 } |
27 | 27 |
28 namespace gfx { | 28 namespace gfx { |
29 class Rect; | 29 class Rect; |
30 } | 30 } |
31 | 31 |
32 namespace chrome { | 32 namespace chrome { |
33 | 33 |
34 class BrowserInstantController : public content::NotificationObserver, | 34 class BrowserInstantController : public content::NotificationObserver, |
35 public search::SearchModelObserver { | 35 public search::SearchModelObserver { |
36 public: | 36 public: |
37 explicit BrowserInstantController(Browser* browser); | 37 explicit BrowserInstantController(Browser* browser); |
38 virtual ~BrowserInstantController(); | 38 virtual ~BrowserInstantController(); |
39 | 39 |
40 // Returns true if Instant is enabled in a visible, preview-showing mode. | 40 // Returns true if Instant is enabled in a visible, preview-showing mode. |
41 static bool IsInstantEnabled(Profile* profile); | 41 static bool IsInstantEnabled(Profile* profile); |
42 | 42 |
43 // Registers Instant related preferences. | 43 // Registers Instant related preferences. |
44 static void RegisterUserPrefs(PrefService* prefs); | 44 static void RegisterUserPrefs(PrefServiceSyncable* prefs); |
45 | 45 |
46 // Commits the current Instant, returning true on success. This is intended | 46 // Commits the current Instant, returning true on success. This is intended |
47 // for use from OpenCurrentURL. | 47 // for use from OpenCurrentURL. |
48 bool OpenInstant(WindowOpenDisposition disposition); | 48 bool OpenInstant(WindowOpenDisposition disposition); |
49 | 49 |
50 // Returns the InstantController or NULL if there is no InstantController for | 50 // Returns the InstantController or NULL if there is no InstantController for |
51 // this BrowserInstantController. | 51 // this BrowserInstantController. |
52 InstantController* instant() { return &instant_; } | 52 InstantController* instant() { return &instant_; } |
53 | 53 |
54 // Invoked by |instant_| to commit the |preview| by merging it into the active | 54 // Invoked by |instant_| to commit the |preview| by merging it into the active |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 PrefChangeRegistrar profile_pref_registrar_; | 126 PrefChangeRegistrar profile_pref_registrar_; |
127 | 127 |
128 content::NotificationRegistrar registrar_; | 128 content::NotificationRegistrar registrar_; |
129 | 129 |
130 DISALLOW_COPY_AND_ASSIGN(BrowserInstantController); | 130 DISALLOW_COPY_AND_ASSIGN(BrowserInstantController); |
131 }; | 131 }; |
132 | 132 |
133 } // namespace chrome | 133 } // namespace chrome |
134 | 134 |
135 #endif // CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ | 135 #endif // CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ |
OLD | NEW |