| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // for use from OpenCurrentURL. | 51 // for use from OpenCurrentURL. |
| 52 bool OpenInstant(WindowOpenDisposition disposition, const GURL& url); | 52 bool OpenInstant(WindowOpenDisposition disposition, const GURL& url); |
| 53 | 53 |
| 54 // Returns the Profile associated with the Browser that owns this object. | 54 // Returns the Profile associated with the Browser that owns this object. |
| 55 Profile* profile() const; | 55 Profile* profile() const; |
| 56 | 56 |
| 57 // Returns the InstantController or NULL if there is no InstantController for | 57 // Returns the InstantController or NULL if there is no InstantController for |
| 58 // this BrowserInstantController. | 58 // this BrowserInstantController. |
| 59 InstantController* instant() { return &instant_; } | 59 InstantController* instant() { return &instant_; } |
| 60 | 60 |
| 61 // Invoked by |instant_| to commit the |overlay| by merging it into the active | |
| 62 // tab or adding it as a new tab. | |
| 63 void CommitInstant(scoped_ptr<content::WebContents> overlay, bool in_new_tab); | |
| 64 | |
| 65 // Invoked by |instant_| to autocomplete the |suggestion| into the omnibox. | |
| 66 void SetInstantSuggestion(const InstantSuggestion& suggestion); | |
| 67 | |
| 68 // Invoked by |instant_| to get the bounds that the overlay is placed at, | |
| 69 // in screen coordinates. | |
| 70 gfx::Rect GetInstantBounds(); | |
| 71 | |
| 72 // Invoked by |instant_| to notify that the overlay gained focus, usually due | |
| 73 // to the user clicking on it. | |
| 74 void InstantOverlayFocused(); | |
| 75 | |
| 76 // Invoked by |instant_| to give the omnibox focus, with the option of making | 61 // Invoked by |instant_| to give the omnibox focus, with the option of making |
| 77 // the caret invisible. | 62 // the caret invisible. |
| 78 void FocusOmnibox(bool caret_visibility); | 63 void FocusOmnibox(bool caret_visibility); |
| 79 | 64 |
| 80 // Invoked by |instant_| to get the currently active tab, over which the | 65 // Invoked by |instant_| to get the currently active tab. |
| 81 // overlay would be shown. | |
| 82 content::WebContents* GetActiveWebContents() const; | 66 content::WebContents* GetActiveWebContents() const; |
| 83 | 67 |
| 84 // Invoked by |browser_| when the active tab changes. | 68 // Invoked by |browser_| when the active tab changes. |
| 85 void ActiveTabChanged(); | 69 void ActiveTabChanged(); |
| 86 | 70 |
| 87 // Invoked by |browser_| when the active tab is about to be deactivated. | 71 // Invoked by |browser_| when the active tab is about to be deactivated. |
| 88 void TabDeactivated(content::WebContents* contents); | 72 void TabDeactivated(content::WebContents* contents); |
| 89 | 73 |
| 90 // Invoked by the InstantController when it wants to open a URL. | 74 // Invoked by the InstantController when it wants to open a URL. |
| 91 void OpenURL(const GURL& url, | 75 void OpenURL(const GURL& url, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 114 |
| 131 InstantController instant_; | 115 InstantController instant_; |
| 132 InstantUnloadHandler instant_unload_handler_; | 116 InstantUnloadHandler instant_unload_handler_; |
| 133 | 117 |
| 134 PrefChangeRegistrar profile_pref_registrar_; | 118 PrefChangeRegistrar profile_pref_registrar_; |
| 135 | 119 |
| 136 DISALLOW_COPY_AND_ASSIGN(BrowserInstantController); | 120 DISALLOW_COPY_AND_ASSIGN(BrowserInstantController); |
| 137 }; | 121 }; |
| 138 | 122 |
| 139 #endif // CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ | 123 #endif // CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ |
| OLD | NEW |