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" |
(...skipping 26 matching lines...) Expand all Loading... |
37 // Returns the InstantController or NULL if there is no InstantController for | 37 // Returns the InstantController or NULL if there is no InstantController for |
38 // this BrowserInstantController. | 38 // this BrowserInstantController. |
39 InstantController* instant() { return &instant_; } | 39 InstantController* instant() { return &instant_; } |
40 | 40 |
41 // Invoked by |instant_| to get the currently active tab. | 41 // Invoked by |instant_| to get the currently active tab. |
42 content::WebContents* GetActiveWebContents() const; | 42 content::WebContents* GetActiveWebContents() const; |
43 | 43 |
44 // Invoked by |browser_| when the active tab changes. | 44 // Invoked by |browser_| when the active tab changes. |
45 void ActiveTabChanged(); | 45 void ActiveTabChanged(); |
46 | 46 |
| 47 // Invoked by |browser_| when a new WebContents was inserted into the |
| 48 // TabStripModel at the specified index |foreground| is whether or not it was |
| 49 // opened in the foreground (selected). |
| 50 void TabInsertedAt(content::WebContents* contents, |
| 51 int index, |
| 52 bool foreground); |
| 53 |
47 // Invoked by |browser_| when the active tab is about to be deactivated. | 54 // Invoked by |browser_| when the active tab is about to be deactivated. |
48 void TabDeactivated(content::WebContents* contents); | 55 void TabDeactivated(content::WebContents* contents); |
49 | 56 |
50 private: | 57 private: |
51 // SearchModelObserver: | 58 // SearchModelObserver: |
52 virtual void ModelChanged(const SearchModel::State& old_state, | 59 virtual void ModelChanged(const SearchModel::State& old_state, |
53 const SearchModel::State& new_state) OVERRIDE; | 60 const SearchModel::State& new_state) OVERRIDE; |
54 | 61 |
55 // InstantServiceObserver: | 62 // InstantServiceObserver: |
56 virtual void DefaultSearchProviderChanged() OVERRIDE; | 63 virtual void DefaultSearchProviderChanged() OVERRIDE; |
57 | 64 |
58 // Replaces the contents at tab |index| with |new_contents| and deletes the | 65 // Replaces the contents at tab |index| with |new_contents| and deletes the |
59 // existing contents. | 66 // existing contents. |
60 void ReplaceWebContentsAt(int index, | 67 void ReplaceWebContentsAt(int index, |
61 scoped_ptr<content::WebContents> new_contents); | 68 scoped_ptr<content::WebContents> new_contents); |
62 | 69 |
63 Browser* const browser_; | 70 Browser* const browser_; |
64 | 71 |
65 InstantController instant_; | 72 InstantController instant_; |
66 | 73 |
67 DISALLOW_COPY_AND_ASSIGN(BrowserInstantController); | 74 DISALLOW_COPY_AND_ASSIGN(BrowserInstantController); |
68 }; | 75 }; |
69 | 76 |
70 #endif // CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ | 77 #endif // CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ |
OLD | NEW |