OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "chrome/browser/ui/browser_instant_controller.h" | 5 #include "chrome/browser/ui/browser_instant_controller.h" |
6 | 6 |
7 #include "chrome/browser/browser_shutdown.h" | 7 #include "chrome/browser/browser_shutdown.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/instant/instant_controller.h" | 9 #include "chrome/browser/instant/instant_controller.h" |
10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 gfx::Rect BrowserInstantController::GetInstantBounds() { | 108 gfx::Rect BrowserInstantController::GetInstantBounds() { |
109 return browser_->window()->GetInstantBounds(); | 109 return browser_->window()->GetInstantBounds(); |
110 } | 110 } |
111 | 111 |
112 void BrowserInstantController::InstantPreviewFocused() { | 112 void BrowserInstantController::InstantPreviewFocused() { |
113 // NOTE: This is only invoked on aura. | 113 // NOTE: This is only invoked on aura. |
114 browser_->window()->WebContentsFocused( | 114 browser_->window()->WebContentsFocused( |
115 instant_->GetPreviewContents()->web_contents()); | 115 instant_->GetPreviewContents()->web_contents()); |
116 } | 116 } |
117 | 117 |
| 118 void BrowserInstantController::OnWebSearchBoxBlur() { |
| 119 chrome::search::SearchTabHelper::FromWebContents( |
| 120 GetActiveTabContents()->web_contents())->OnWebSearchBoxBlur(); |
| 121 } |
| 122 |
| 123 void BrowserInstantController::OnWebSearchBoxFocus() { |
| 124 chrome::search::SearchTabHelper::FromWebContents( |
| 125 GetActiveTabContents()->web_contents())->OnWebSearchBoxFocus(); |
| 126 } |
| 127 |
118 TabContents* BrowserInstantController::GetActiveTabContents() const { | 128 TabContents* BrowserInstantController::GetActiveTabContents() const { |
119 return chrome::GetActiveTabContents(browser_); | 129 return chrome::GetActiveTabContents(browser_); |
120 } | 130 } |
121 | 131 |
122 //////////////////////////////////////////////////////////////////////////////// | 132 //////////////////////////////////////////////////////////////////////////////// |
123 // BrowserInstantController, PrefObserver implementation: | 133 // BrowserInstantController, PrefObserver implementation: |
124 | 134 |
125 void BrowserInstantController::OnPreferenceChanged( | 135 void BrowserInstantController::OnPreferenceChanged( |
126 PrefServiceBase* service, | 136 PrefServiceBase* service, |
127 const std::string& pref_name) { | 137 const std::string& pref_name) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 InstantController::CreateInstant(browser_->profile(), this) : NULL); | 176 InstantController::CreateInstant(browser_->profile(), this) : NULL); |
167 | 177 |
168 // Notify any observers that they need to reset. | 178 // Notify any observers that they need to reset. |
169 content::NotificationService::current()->Notify( | 179 content::NotificationService::current()->Notify( |
170 chrome::NOTIFICATION_BROWSER_INSTANT_RESET, | 180 chrome::NOTIFICATION_BROWSER_INSTANT_RESET, |
171 content::Source<BrowserInstantController>(this), | 181 content::Source<BrowserInstantController>(this), |
172 content::NotificationService::NoDetails()); | 182 content::NotificationService::NoDetails()); |
173 } | 183 } |
174 | 184 |
175 } // namespace chrome | 185 } // namespace chrome |
OLD | NEW |