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

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

Issue 2251263003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/extensions/extension_enable_flow.cc ('k') | chrome/browser/ui/omnibox/omnibox_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698