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 <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/prefs/pref_change_registrar.h" | 12 #include "base/prefs/pref_change_registrar.h" |
13 #include "chrome/browser/ui/search/instant_controller.h" | 13 #include "chrome/browser/ui/search/instant_controller.h" |
14 #include "chrome/browser/ui/search/instant_unload_handler.h" | 14 #include "chrome/browser/ui/search/instant_unload_handler.h" |
15 #include "chrome/browser/ui/search/search_model_observer.h" | 15 #include "chrome/browser/ui/search/search_model_observer.h" |
16 #include "chrome/browser/ui/tabs/tab_strip_model.h" | |
16 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
17 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
18 #include "ui/base/window_open_disposition.h" | 19 #include "ui/base/window_open_disposition.h" |
19 | 20 |
20 class Browser; | 21 class Browser; |
21 struct InstantSuggestion; | 22 struct InstantSuggestion; |
22 class Profile; | 23 class Profile; |
23 class ThemeService; | 24 class ThemeService; |
24 | 25 |
25 namespace content { | 26 namespace content { |
(...skipping 22 matching lines...) Expand all Loading... | |
48 content::WebContents* source_contents, | 49 content::WebContents* source_contents, |
49 content::WebContents** target_contents); | 50 content::WebContents** target_contents); |
50 | 51 |
51 // Commits the current Instant, returning true on success. This is intended | 52 // Commits the current Instant, returning true on success. This is intended |
52 // for use from OpenCurrentURL. | 53 // for use from OpenCurrentURL. |
53 bool OpenInstant(WindowOpenDisposition disposition, const GURL& url); | 54 bool OpenInstant(WindowOpenDisposition disposition, const GURL& url); |
54 | 55 |
55 // Returns the Profile associated with the Browser that owns this object. | 56 // Returns the Profile associated with the Browser that owns this object. |
56 Profile* profile() const; | 57 Profile* profile() const; |
57 | 58 |
59 // Returns the TabStripModel associated with the Browser owning this object. | |
60 TabStripModel* tab_strip_model() const; | |
beaudoin
2013/06/20 21:55:44
Can you return a const TabStripModel* ?
annark1
2013/07/04 18:29:15
Done.
| |
61 | |
58 // Returns the InstantController or NULL if there is no InstantController for | 62 // Returns the InstantController or NULL if there is no InstantController for |
59 // this BrowserInstantController. | 63 // this BrowserInstantController. |
60 InstantController* instant() { return &instant_; } | 64 InstantController* instant() { return &instant_; } |
61 | 65 |
62 // Invoked by |instant_| to commit the |overlay| by merging it into the active | 66 // Invoked by |instant_| to commit the |overlay| by merging it into the active |
63 // tab or adding it as a new tab. | 67 // tab or adding it as a new tab. |
64 void CommitInstant(scoped_ptr<content::WebContents> overlay, bool in_new_tab); | 68 void CommitInstant(scoped_ptr<content::WebContents> overlay, bool in_new_tab); |
65 | 69 |
66 // Invoked by |instant_| to autocomplete the |suggestion| into the omnibox. | 70 // Invoked by |instant_| to autocomplete the |suggestion| into the omnibox. |
67 void SetInstantSuggestion(const InstantSuggestion& suggestion); | 71 void SetInstantSuggestion(const InstantSuggestion& suggestion); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
140 ThemeBackgroundInfo theme_info_; | 144 ThemeBackgroundInfo theme_info_; |
141 | 145 |
142 PrefChangeRegistrar profile_pref_registrar_; | 146 PrefChangeRegistrar profile_pref_registrar_; |
143 | 147 |
144 content::NotificationRegistrar registrar_; | 148 content::NotificationRegistrar registrar_; |
145 | 149 |
146 DISALLOW_COPY_AND_ASSIGN(BrowserInstantController); | 150 DISALLOW_COPY_AND_ASSIGN(BrowserInstantController); |
147 }; | 151 }; |
148 | 152 |
149 #endif // CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ | 153 #endif // CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ |
OLD | NEW |