Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: chrome/browser/ui/browser_instant_controller.h

Issue 12079097: Introduce PrefRegistrySyncable, simplifying PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add to PrefRegistrySyncable and PrefServiceSyncable to let sync know of pre-registered prefs. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "ui/base/window_open_disposition.h" 16 #include "ui/base/window_open_disposition.h"
17 17
18 class Browser; 18 class Browser;
19 struct InstantSuggestion; 19 struct InstantSuggestion;
20 class PrefServiceSyncable; 20 class PrefRegistrySyncable;
21 class PrefService;
21 class Profile; 22 class Profile;
22 class ThemeService; 23 class ThemeService;
23 24
24 namespace content { 25 namespace content {
25 class WebContents; 26 class WebContents;
26 } 27 }
27 28
28 namespace gfx { 29 namespace gfx {
29 class Rect; 30 class Rect;
30 } 31 }
31 32
32 namespace chrome { 33 namespace chrome {
33 34
34 class BrowserInstantController : public content::NotificationObserver, 35 class BrowserInstantController : public content::NotificationObserver,
35 public search::SearchModelObserver { 36 public search::SearchModelObserver {
36 public: 37 public:
37 explicit BrowserInstantController(Browser* browser); 38 explicit BrowserInstantController(Browser* browser);
38 virtual ~BrowserInstantController(); 39 virtual ~BrowserInstantController();
39 40
40 // 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.
41 static bool IsInstantEnabled(Profile* profile); 42 static bool IsInstantEnabled(Profile* profile);
42 43
43 // Registers Instant related preferences. 44 // Registers Instant related preferences.
44 static void RegisterUserPrefs(PrefServiceSyncable* prefs); 45 static void RegisterUserPrefs(PrefService* prefs,
46 PrefRegistrySyncable* registry);
45 47
46 // Commits the current Instant, returning true on success. This is intended 48 // Commits the current Instant, returning true on success. This is intended
47 // for use from OpenCurrentURL. 49 // for use from OpenCurrentURL.
48 bool OpenInstant(WindowOpenDisposition disposition); 50 bool OpenInstant(WindowOpenDisposition disposition);
49 51
50 // Returns the InstantController or NULL if there is no InstantController for 52 // Returns the InstantController or NULL if there is no InstantController for
51 // this BrowserInstantController. 53 // this BrowserInstantController.
52 InstantController* instant() { return &instant_; } 54 InstantController* instant() { return &instant_; }
53 55
54 // Invoked by |instant_| to commit the |preview| by merging it into the active 56 // 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
126 PrefChangeRegistrar profile_pref_registrar_; 128 PrefChangeRegistrar profile_pref_registrar_;
127 129
128 content::NotificationRegistrar registrar_; 130 content::NotificationRegistrar registrar_;
129 131
130 DISALLOW_COPY_AND_ASSIGN(BrowserInstantController); 132 DISALLOW_COPY_AND_ASSIGN(BrowserInstantController);
131 }; 133 };
132 134
133 } // namespace chrome 135 } // namespace chrome
134 136
135 #endif // CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ 137 #endif // CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698