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

Side by Side Diff: chrome/browser/ui/webui/options/pepper_flash_content_settings_utils.cc

Issue 2909273003: Replace raw ptr from ContentSettingsPattern Builder with unique_ptr (Closed)
Patch Set: remove more auto Created 3 years, 6 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/webui/options/pepper_flash_content_settings_utils.h" 5 #include "chrome/browser/ui/webui/options/pepper_flash_content_settings_utils.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 9
10 namespace options { 10 namespace options {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } 50 }
51 return CONTENT_SETTING_DEFAULT; 51 return CONTENT_SETTING_DEFAULT;
52 } 52 }
53 53
54 // static 54 // static
55 void PepperFlashContentSettingsUtils::FlashSiteSettingsToMediaExceptions( 55 void PepperFlashContentSettingsUtils::FlashSiteSettingsToMediaExceptions(
56 const ppapi::FlashSiteSettings& site_settings, 56 const ppapi::FlashSiteSettings& site_settings,
57 MediaExceptions* media_exceptions) { 57 MediaExceptions* media_exceptions) {
58 media_exceptions->clear(); 58 media_exceptions->clear();
59 59
60 std::unique_ptr<ContentSettingsPattern::BuilderInterface> builder( 60 std::unique_ptr<ContentSettingsPattern::BuilderInterface> builder =
61 ContentSettingsPattern::CreateBuilder(false)); 61 ContentSettingsPattern::CreateBuilder();
62 builder->WithSchemeWildcard()->WithPortWildcard(); 62 builder->WithSchemeWildcard()->WithPortWildcard();
63 for (ppapi::FlashSiteSettings::const_iterator iter = site_settings.begin(); 63 for (ppapi::FlashSiteSettings::const_iterator iter = site_settings.begin();
64 iter != site_settings.end(); ++iter) { 64 iter != site_settings.end(); ++iter) {
65 builder->WithHost(iter->site); 65 builder->WithHost(iter->site);
66 66
67 ContentSettingsPattern pattern = builder->Build(); 67 ContentSettingsPattern pattern = builder->Build();
68 if (!pattern.IsValid()) 68 if (!pattern.IsValid())
69 continue; 69 continue;
70 70
71 ContentSetting setting = FlashPermissionToContentSetting(iter->permission); 71 ContentSetting setting = FlashPermissionToContentSetting(iter->permission);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 121 }
122 while (iter_2 != exceptions_2.end()) { 122 while (iter_2 != exceptions_2.end()) {
123 if (iter_2->setting != default_exception_1.setting) 123 if (iter_2->setting != default_exception_1.setting)
124 return false; 124 return false;
125 ++iter_2; 125 ++iter_2;
126 } 126 }
127 return true; 127 return true;
128 } 128 }
129 129
130 } // namespace options 130 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698