| OLD | NEW |
| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 120 |
| 121 ChromeOmniboxClient::~ChromeOmniboxClient() { | 121 ChromeOmniboxClient::~ChromeOmniboxClient() { |
| 122 BitmapFetcherService* image_service = | 122 BitmapFetcherService* image_service = |
| 123 BitmapFetcherServiceFactory::GetForBrowserContext(profile_); | 123 BitmapFetcherServiceFactory::GetForBrowserContext(profile_); |
| 124 if (image_service) | 124 if (image_service) |
| 125 image_service->CancelRequest(request_id_); | 125 image_service->CancelRequest(request_id_); |
| 126 } | 126 } |
| 127 | 127 |
| 128 std::unique_ptr<AutocompleteProviderClient> | 128 std::unique_ptr<AutocompleteProviderClient> |
| 129 ChromeOmniboxClient::CreateAutocompleteProviderClient() { | 129 ChromeOmniboxClient::CreateAutocompleteProviderClient() { |
| 130 return base::WrapUnique(new ChromeAutocompleteProviderClient(profile_)); | 130 return base::MakeUnique<ChromeAutocompleteProviderClient>(profile_); |
| 131 } | 131 } |
| 132 | 132 |
| 133 std::unique_ptr<OmniboxNavigationObserver> | 133 std::unique_ptr<OmniboxNavigationObserver> |
| 134 ChromeOmniboxClient::CreateOmniboxNavigationObserver( | 134 ChromeOmniboxClient::CreateOmniboxNavigationObserver( |
| 135 const base::string16& text, | 135 const base::string16& text, |
| 136 const AutocompleteMatch& match, | 136 const AutocompleteMatch& match, |
| 137 const AutocompleteMatch& alternate_nav_match) { | 137 const AutocompleteMatch& alternate_nav_match) { |
| 138 return base::WrapUnique(new ChromeOmniboxNavigationObserver( | 138 return base::MakeUnique<ChromeOmniboxNavigationObserver>( |
| 139 profile_, text, match, alternate_nav_match)); | 139 profile_, text, match, alternate_nav_match); |
| 140 } | 140 } |
| 141 | 141 |
| 142 bool ChromeOmniboxClient::CurrentPageExists() const { | 142 bool ChromeOmniboxClient::CurrentPageExists() const { |
| 143 return (controller_->GetWebContents() != NULL); | 143 return (controller_->GetWebContents() != NULL); |
| 144 } | 144 } |
| 145 | 145 |
| 146 const GURL& ChromeOmniboxClient::GetURL() const { | 146 const GURL& ChromeOmniboxClient::GetURL() const { |
| 147 return controller_->GetWebContents()->GetVisibleURL(); | 147 return controller_->GetWebContents()->GetVisibleURL(); |
| 148 } | 148 } |
| 149 | 149 |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 InstantSearchPrerenderer::GetForProfile(profile_); | 451 InstantSearchPrerenderer::GetForProfile(profile_); |
| 452 if (prerenderer) | 452 if (prerenderer) |
| 453 prerenderer->Prerender(suggestion); | 453 prerenderer->Prerender(suggestion); |
| 454 } | 454 } |
| 455 | 455 |
| 456 void ChromeOmniboxClient::OnBitmapFetched(const BitmapFetchedCallback& callback, | 456 void ChromeOmniboxClient::OnBitmapFetched(const BitmapFetchedCallback& callback, |
| 457 const SkBitmap& bitmap) { | 457 const SkBitmap& bitmap) { |
| 458 request_id_ = BitmapFetcherService::REQUEST_ID_INVALID; | 458 request_id_ = BitmapFetcherService::REQUEST_ID_INVALID; |
| 459 callback.Run(bitmap); | 459 callback.Run(bitmap); |
| 460 } | 460 } |
| OLD | NEW |