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

Side by Side Diff: chrome/browser/ui/content_settings/content_setting_image_model.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 (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/content_settings/content_setting_image_model.h" 5 #include "chrome/browser/ui/content_settings/content_setting_image_model.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 TabSpecificContentSettings::FromWebContents(web_contents); 197 TabSpecificContentSettings::FromWebContents(web_contents);
198 if (content_settings) 198 if (content_settings)
199 content_settings->SetBlockageHasBeenIndicated(content_type()); 199 content_settings->SetBlockageHasBeenIndicated(content_type());
200 } 200 }
201 201
202 // static 202 // static
203 std::unique_ptr<ContentSettingImageModel> 203 std::unique_ptr<ContentSettingImageModel>
204 ContentSettingSimpleImageModel::CreateForContentTypeForTesting( 204 ContentSettingSimpleImageModel::CreateForContentTypeForTesting(
205 ContentSettingsType content_settings_type) { 205 ContentSettingsType content_settings_type) {
206 if (content_settings_type == CONTENT_SETTINGS_TYPE_GEOLOCATION) 206 if (content_settings_type == CONTENT_SETTINGS_TYPE_GEOLOCATION)
207 return base::WrapUnique(new ContentSettingGeolocationImageModel()); 207 return base::MakeUnique<ContentSettingGeolocationImageModel>();
208 208
209 if (content_settings_type == CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS) 209 if (content_settings_type == CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS)
210 return base::WrapUnique(new ContentSettingRPHImageModel()); 210 return base::MakeUnique<ContentSettingRPHImageModel>();
211 211
212 if (content_settings_type == CONTENT_SETTINGS_TYPE_MIDI_SYSEX) 212 if (content_settings_type == CONTENT_SETTINGS_TYPE_MIDI_SYSEX)
213 return base::WrapUnique(new ContentSettingMIDISysExImageModel()); 213 return base::MakeUnique<ContentSettingMIDISysExImageModel>();
214 214
215 return base::WrapUnique( 215 return base::MakeUnique<ContentSettingBlockedImageModel>(
216 new ContentSettingBlockedImageModel(content_settings_type)); 216 content_settings_type);
217 } 217 }
218 218
219 // Generic blocked content settings -------------------------------------------- 219 // Generic blocked content settings --------------------------------------------
220 220
221 ContentSettingBlockedImageModel::ContentSettingBlockedImageModel( 221 ContentSettingBlockedImageModel::ContentSettingBlockedImageModel(
222 ContentSettingsType content_type) 222 ContentSettingsType content_type)
223 : ContentSettingSimpleImageModel(content_type) { 223 : ContentSettingSimpleImageModel(content_type) {
224 } 224 }
225 225
226 void ContentSettingBlockedImageModel::UpdateFromWebContents( 226 void ContentSettingBlockedImageModel::UpdateFromWebContents(
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 569
570 #if defined(OS_MACOSX) 570 #if defined(OS_MACOSX)
571 bool ContentSettingImageModel::UpdateFromWebContentsAndCheckIfIconChanged( 571 bool ContentSettingImageModel::UpdateFromWebContentsAndCheckIfIconChanged(
572 content::WebContents* web_contents) { 572 content::WebContents* web_contents) {
573 gfx::VectorIconId old_icon = icon_id_; 573 gfx::VectorIconId old_icon = icon_id_;
574 gfx::VectorIconId old_badge_icon = icon_badge_id_; 574 gfx::VectorIconId old_badge_icon = icon_badge_id_;
575 UpdateFromWebContents(web_contents); 575 UpdateFromWebContents(web_contents);
576 return old_icon != icon_id_ && old_badge_icon != icon_badge_id_; 576 return old_icon != icon_id_ && old_badge_icon != icon_badge_id_;
577 } 577 }
578 #endif 578 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698