| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // for use from OpenCurrentURL. | 48 // for use from OpenCurrentURL. |
| 49 bool OpenInstant(WindowOpenDisposition disposition, const GURL& url); | 49 bool OpenInstant(WindowOpenDisposition disposition, const GURL& url); |
| 50 | 50 |
| 51 // Returns the Profile associated with the Browser that owns this object. | 51 // Returns the Profile associated with the Browser that owns this object. |
| 52 Profile* profile() const; | 52 Profile* profile() const; |
| 53 | 53 |
| 54 // Returns the InstantController or NULL if there is no InstantController for | 54 // Returns the InstantController or NULL if there is no InstantController for |
| 55 // this BrowserInstantController. | 55 // this BrowserInstantController. |
| 56 InstantController* instant() { return &instant_; } | 56 InstantController* instant() { return &instant_; } |
| 57 | 57 |
| 58 // Invoked by |instant_| to give the omnibox focus, with the option of making | 58 // Invoked by |instant_| to change the omnibox focus. |
| 59 // the caret invisible. | 59 void FocusOmnibox(OmniboxFocusState state); |
| 60 void FocusOmnibox(bool caret_visibility); | |
| 61 | 60 |
| 62 // Invoked by |instant_| to get the currently active tab. | 61 // Invoked by |instant_| to get the currently active tab. |
| 63 content::WebContents* GetActiveWebContents() const; | 62 content::WebContents* GetActiveWebContents() const; |
| 64 | 63 |
| 65 // Invoked by |browser_| when the active tab changes. | 64 // Invoked by |browser_| when the active tab changes. |
| 66 void ActiveTabChanged(); | 65 void ActiveTabChanged(); |
| 67 | 66 |
| 68 // Invoked by |browser_| when the active tab is about to be deactivated. | 67 // Invoked by |browser_| when the active tab is about to be deactivated. |
| 69 void TabDeactivated(content::WebContents* contents); | 68 void TabDeactivated(content::WebContents* contents); |
| 70 | 69 |
| 71 // Invoked by the InstantController when it wants to open a URL. | 70 // Invoked by the InstantController when it wants to open a URL. |
| 72 void OpenURL(const GURL& url, | 71 void OpenURL(const GURL& url, |
| 73 content::PageTransition transition, | 72 content::PageTransition transition, |
| 74 WindowOpenDisposition disposition); | 73 WindowOpenDisposition disposition); |
| 75 | 74 |
| 75 // Invoked by |instant_| to paste the |text| (or clipboard content if text is |
| 76 // empty) into the omnibox. It will set focus to the omnibox if the omnibox is |
| 77 // not focused. |
| 78 void PasteIntoOmnibox(const string16& text); |
| 79 |
| 76 // Sets the stored omnibox bounds. | 80 // Sets the stored omnibox bounds. |
| 77 void SetOmniboxBounds(const gfx::Rect& bounds); | 81 void SetOmniboxBounds(const gfx::Rect& bounds); |
| 78 | 82 |
| 79 // Notifies |instant_| to toggle voice search. | 83 // Notifies |instant_| to toggle voice search. |
| 80 void ToggleVoiceSearch(); | 84 void ToggleVoiceSearch(); |
| 81 | 85 |
| 82 private: | 86 private: |
| 83 // Overridden from search::SearchModelObserver: | 87 // Overridden from search::SearchModelObserver: |
| 84 virtual void ModelChanged(const SearchModel::State& old_state, | 88 virtual void ModelChanged(const SearchModel::State& old_state, |
| 85 const SearchModel::State& new_state) OVERRIDE; | 89 const SearchModel::State& new_state) OVERRIDE; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 99 | 103 |
| 100 InstantController instant_; | 104 InstantController instant_; |
| 101 InstantUnloadHandler instant_unload_handler_; | 105 InstantUnloadHandler instant_unload_handler_; |
| 102 | 106 |
| 103 PrefChangeRegistrar profile_pref_registrar_; | 107 PrefChangeRegistrar profile_pref_registrar_; |
| 104 | 108 |
| 105 DISALLOW_COPY_AND_ASSIGN(BrowserInstantController); | 109 DISALLOW_COPY_AND_ASSIGN(BrowserInstantController); |
| 106 }; | 110 }; |
| 107 | 111 |
| 108 #endif // CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ | 112 #endif // CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ |
| OLD | NEW |