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

Unified Diff: chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm

Issue 2468403003: Remove stl_util's deletion function use from cocoa content_settings. (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm b/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm
index b77d297bc3dd217849665c763ded98ac7451d38a..a83d26e2e827e5ce2a01716b721f858ed115e652 100644
--- a/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm
+++ b/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm
@@ -9,7 +9,7 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/stl_util.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/plugins/plugin_finder.h"
@@ -306,11 +306,6 @@ const ContentTypeToNibPath kNibPaths[] = {
return nibPath;
}
-- (void)dealloc {
- base::STLDeleteValues(&mediaMenus_);
- [super dealloc];
-}
-
- (void)initializeTitle {
if (!titleLabel_)
return;
@@ -608,7 +603,7 @@ const ContentTypeToNibPath kNibPaths[] = {
menuParts->model.reset(new ContentSettingMediaMenuModel(
map_entry.first, contentSettingBubbleModel_.get(),
ContentSettingMediaMenuModel::MenuLabelChangedCallback()));
- mediaMenus_[button] = menuParts;
+ mediaMenus_[button] = base::WrapUnique(menuParts);
CGFloat width = BuildPopUpMenuFromModel(
button, menuParts->model.get(), map_entry.second.selected_device.name,
map_entry.second.disabled);
@@ -643,8 +638,7 @@ const ContentTypeToNibPath kNibPaths[] = {
// Resize and reposition the media menus layout.
CGFloat topMenuY = NSMinY(radioFrame) - kMediaMenuVerticalPadding;
maxMenuWidth = std::max(maxMenuWidth, kMinMediaMenuButtonWidth);
- for (const std::pair<NSPopUpButton*, content_setting_bubble::MediaMenuParts*>&
- map_entry : mediaMenus_) {
+ for (const auto& map_entry : mediaMenus_) {
NSRect labelFrame = [map_entry.second->label frame];
// Align the label text with the button text.
labelFrame.origin.y =
@@ -869,8 +863,7 @@ const ContentTypeToNibPath kNibPaths[] = {
- (IBAction)mediaMenuChanged:(id)sender {
NSPopUpButton* button = static_cast<NSPopUpButton*>(sender);
- content_setting_bubble::MediaMenuPartsMap::const_iterator it(
- mediaMenus_.find(sender));
+ auto it = mediaMenus_.find(sender);
DCHECK(it != mediaMenus_.end());
NSInteger index = [[button selectedItem] tag];
« no previous file with comments | « chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698