Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(475)

Side by Side Diff: chrome/browser/ui/omnibox/chrome_omnibox_client.cc

Issue 2381373003: Fixed the issue shows keyword hint when omnibox loses its focus. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/omnibox/chrome_omnibox_client.h" 5 #include "chrome/browser/ui/omnibox/chrome_omnibox_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 return; 249 return;
250 SearchTabHelper::FromWebContents( 250 SearchTabHelper::FromWebContents(
251 controller_->GetWebContents())->OmniboxInputStateChanged(); 251 controller_->GetWebContents())->OmniboxInputStateChanged();
252 } 252 }
253 253
254 void ChromeOmniboxClient::OnFocusChanged( 254 void ChromeOmniboxClient::OnFocusChanged(
255 OmniboxFocusState state, 255 OmniboxFocusState state,
256 OmniboxFocusChangeReason reason) { 256 OmniboxFocusChangeReason reason) {
257 if (!controller_->GetWebContents()) 257 if (!controller_->GetWebContents())
258 return; 258 return;
259
260 controller_->OnFocusChanged(state);
261
259 SearchTabHelper::FromWebContents( 262 SearchTabHelper::FromWebContents(
260 controller_->GetWebContents())->OmniboxFocusChanged(state, reason); 263 controller_->GetWebContents())->OmniboxFocusChanged(state, reason);
261 } 264 }
262 265
263 void ChromeOmniboxClient::OnResultChanged( 266 void ChromeOmniboxClient::OnResultChanged(
264 const AutocompleteResult& result, 267 const AutocompleteResult& result,
265 bool default_match_changed, 268 bool default_match_changed,
266 const base::Callback<void(const SkBitmap& bitmap)>& on_bitmap_fetched) { 269 const base::Callback<void(const SkBitmap& bitmap)>& on_bitmap_fetched) {
267 if (search::IsInstantExtendedAPIEnabled() && 270 if (search::IsInstantExtendedAPIEnabled() &&
268 (default_match_changed && result.default_match() != result.end())) { 271 (default_match_changed && result.default_match() != result.end())) {
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 InstantSearchPrerenderer::GetForProfile(profile_); 454 InstantSearchPrerenderer::GetForProfile(profile_);
452 if (prerenderer) 455 if (prerenderer)
453 prerenderer->Prerender(suggestion); 456 prerenderer->Prerender(suggestion);
454 } 457 }
455 458
456 void ChromeOmniboxClient::OnBitmapFetched(const BitmapFetchedCallback& callback, 459 void ChromeOmniboxClient::OnBitmapFetched(const BitmapFetchedCallback& callback,
457 const SkBitmap& bitmap) { 460 const SkBitmap& bitmap) {
458 request_id_ = BitmapFetcherService::REQUEST_ID_INVALID; 461 request_id_ = BitmapFetcherService::REQUEST_ID_INVALID;
459 callback.Run(bitmap); 462 callback.Run(bitmap);
460 } 463 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698