Chromium Code Reviews| 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 #include "chrome/browser/ui/browser_instant_controller.h" | 5 #include "chrome/browser/ui/browser_instant_controller.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/extension_web_ui.h" | 10 #include "chrome/browser/extensions/extension_web_ui.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 182 const GURL& url, | 182 const GURL& url, |
| 183 content::PageTransition transition, | 183 content::PageTransition transition, |
| 184 WindowOpenDisposition disposition) { | 184 WindowOpenDisposition disposition) { |
| 185 browser_->OpenURL(content::OpenURLParams(url, | 185 browser_->OpenURL(content::OpenURLParams(url, |
| 186 content::Referrer(), | 186 content::Referrer(), |
| 187 disposition, | 187 disposition, |
| 188 transition, | 188 transition, |
| 189 false)); | 189 false)); |
| 190 } | 190 } |
| 191 | 191 |
| 192 void BrowserInstantController::PasteIntoOmnibox() { | |
| 193 OmniboxView* omnibox_view = browser_->window()->GetLocationBar()-> | |
| 194 GetLocationEntry(); | |
| 195 string16 clipboardText = omnibox_view->GetClipboardText(); | |
| 196 | |
| 197 if (!clipboardText.empty()) { | |
| 198 omnibox_view->OnBeforePossibleChange(); | |
| 199 omnibox_view->SetUserText(clipboardText); | |
|
samarth
2013/07/26 22:51:41
I think you also want to call omnibox_view->model(
jfweitz
2013/07/29 18:48:25
Done.
| |
| 200 omnibox_view->OnAfterPossibleChange(); | |
| 201 } | |
| 202 } | |
| 203 | |
| 192 void BrowserInstantController::SetOmniboxBounds(const gfx::Rect& bounds) { | 204 void BrowserInstantController::SetOmniboxBounds(const gfx::Rect& bounds) { |
| 193 instant_.SetOmniboxBounds(bounds); | 205 instant_.SetOmniboxBounds(bounds); |
| 194 } | 206 } |
| 195 | 207 |
| 196 void BrowserInstantController::ToggleVoiceSearch() { | 208 void BrowserInstantController::ToggleVoiceSearch() { |
| 197 instant_.ToggleVoiceSearch(); | 209 instant_.ToggleVoiceSearch(); |
| 198 } | 210 } |
| 199 | 211 |
| 200 //////////////////////////////////////////////////////////////////////////////// | 212 //////////////////////////////////////////////////////////////////////////////// |
| 201 // BrowserInstantController, SearchModelObserver implementation: | 213 // BrowserInstantController, SearchModelObserver implementation: |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 254 | 266 |
| 255 if (!instant_service->IsInstantProcess( | 267 if (!instant_service->IsInstantProcess( |
| 256 contents->GetRenderProcessHost()->GetID())) | 268 contents->GetRenderProcessHost()->GetID())) |
| 257 continue; | 269 continue; |
| 258 | 270 |
| 259 // Reload the contents to ensure that it gets assigned to a non-priviledged | 271 // Reload the contents to ensure that it gets assigned to a non-priviledged |
| 260 // renderer. | 272 // renderer. |
| 261 contents->GetController().Reload(false); | 273 contents->GetController().Reload(false); |
| 262 } | 274 } |
| 263 } | 275 } |
| OLD | NEW |