diff options
Diffstat (limited to 'chrome/browser/ui/cocoa')
36 files changed, 164 insertions, 96 deletions
diff --git a/chrome/browser/ui/cocoa/accelerators_cocoa.mm b/chrome/browser/ui/cocoa/accelerators_cocoa.mm index 9d08d37..6038cac 100644 --- a/chrome/browser/ui/cocoa/accelerators_cocoa.mm +++ b/chrome/browser/ui/cocoa/accelerators_cocoa.mm @@ -7,6 +7,8 @@ #import <Cocoa/Cocoa.h> #include <stddef.h> +#include <utility> + #include "base/logging.h" #include "base/macros.h" #include "base/memory/singleton.h" @@ -127,7 +129,7 @@ ui::Accelerator AcceleratorFromKeyCode(ui::KeyboardCode key_code, scoped_ptr<ui::PlatformAccelerator> platform_accelerator = PlatformAcceleratorFromKeyCode(key_code, cocoa_modifiers); - accelerator.set_platform_accelerator(platform_accelerator.Pass()); + accelerator.set_platform_accelerator(std::move(platform_accelerator)); return accelerator; } diff --git a/chrome/browser/ui/cocoa/autofill/layout_view.mm b/chrome/browser/ui/cocoa/autofill/layout_view.mm index 04881e2..59e7db9 100644 --- a/chrome/browser/ui/cocoa/autofill/layout_view.mm +++ b/chrome/browser/ui/cocoa/autofill/layout_view.mm @@ -4,12 +4,14 @@ #import "chrome/browser/ui/cocoa/autofill/layout_view.h" +#include <utility> + #include "chrome/browser/ui/cocoa/autofill/simple_grid_layout.h" @implementation LayoutView - (void)setLayoutManager:(scoped_ptr<SimpleGridLayout>)layout { - layout_ = layout.Pass(); + layout_ = std::move(layout); } - (SimpleGridLayout*)layoutManager { diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm index 58b55a3..0299daa 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller.mm @@ -6,6 +6,7 @@ #include <cmath> #include <numeric> +#include <utility> #include "base/command_line.h" #include "base/mac/bundle_locations.h" @@ -1674,11 +1675,11 @@ void SetUpBrowserWindowCommandHandler(NSWindow* window) { sourceLanguage, targetLanguage)); scoped_ptr<TranslateBubbleModel> model( - new TranslateBubbleModelImpl(step, uiDelegate.Pass())); - translateBubbleController_ = [[TranslateBubbleController alloc] - initWithParentWindow:self - model:model.Pass() - webContents:contents]; + new TranslateBubbleModelImpl(step, std::move(uiDelegate))); + translateBubbleController_ = + [[TranslateBubbleController alloc] initWithParentWindow:self + model:std::move(model) + webContents:contents]; [translateBubbleController_ showWindow:nil]; NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; diff --git a/chrome/browser/ui/cocoa/confirm_bubble_cocoa.mm b/chrome/browser/ui/cocoa/confirm_bubble_cocoa.mm index a9fa98c..80a5475 100644 --- a/chrome/browser/ui/cocoa/confirm_bubble_cocoa.mm +++ b/chrome/browser/ui/cocoa/confirm_bubble_cocoa.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/confirm_bubble_cocoa.h" +#include <utility> + #include "base/strings/string16.h" #include "chrome/browser/themes/theme_service.h" #import "chrome/browser/ui/cocoa/confirm_bubble_controller.h" @@ -51,7 +53,7 @@ void ShowConfirmBubble(gfx::NativeWindow window, ConfirmBubbleController* controller = [[ConfirmBubbleController alloc] initWithParent:anchor_view origin:origin.ToCGPoint() - model:model.Pass()]; + model:std::move(model)]; [anchor_view addSubview:[controller view] positioned:NSWindowAbove relativeTo:nil]; diff --git a/chrome/browser/ui/cocoa/confirm_bubble_controller.mm b/chrome/browser/ui/cocoa/confirm_bubble_controller.mm index b7143e7..7f7d45d 100644 --- a/chrome/browser/ui/cocoa/confirm_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/confirm_bubble_controller.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/confirm_bubble_controller.h" +#include <utility> + #include "base/strings/sys_string_conversions.h" #import "chrome/browser/ui/cocoa/browser_window_controller.h" #import "chrome/browser/ui/cocoa/confirm_bubble_cocoa.h" @@ -19,7 +21,7 @@ if ((self = [super initWithNibName:nil bundle:nil])) { parent_ = parent; origin_ = origin; - model_ = model.Pass(); + model_ = std::move(model); } return self; } diff --git a/chrome/browser/ui/cocoa/confirm_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/confirm_bubble_controller_unittest.mm index be249f7..4c27458 100644 --- a/chrome/browser/ui/cocoa/confirm_bubble_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/confirm_bubble_controller_unittest.mm @@ -2,12 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#import "chrome/browser/ui/cocoa/confirm_bubble_controller.h" + +#include <utility> + #include "base/compiler_specific.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/confirm_bubble_cocoa.h" -#import "chrome/browser/ui/cocoa/confirm_bubble_controller.h" #include "chrome/browser/ui/confirm_bubble_model.h" #import "testing/gtest_mac.h" #import "ui/gfx/geometry/point.h" @@ -107,7 +110,7 @@ class ConfirmBubbleControllerTest : public CocoaTest { controller_ = [[ConfirmBubbleController alloc] initWithParent:view origin:origin.ToCGPoint() - model:model_.Pass()]; + model:std::move(model_)]; [view addSubview:[controller_ view] positioned:NSWindowAbove relativeTo:nil]; diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm index f043fad..16f755c 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm @@ -4,6 +4,8 @@ #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" +#include <utility> + #include "base/logging.h" #include "base/memory/scoped_ptr.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet.h" @@ -29,7 +31,8 @@ ConstrainedWindowMac::ConstrainedWindowMac( auto manager = WebContentsModalDialogManager::FromWebContents(web_contents); scoped_ptr<SingleWebContentsDialogManagerCocoa> native_manager( new SingleWebContentsDialogManagerCocoa(this, sheet, manager)); - manager->ShowDialogWithManager([sheet sheetWindow], native_manager.Pass()); + manager->ShowDialogWithManager([sheet sheetWindow], + std::move(native_manager)); } ConstrainedWindowMac::~ConstrainedWindowMac() { diff --git a/chrome/browser/ui/cocoa/download/download_shelf_controller_unittest.mm b/chrome/browser/ui/cocoa/download/download_shelf_controller_unittest.mm index 48f3579..2fd6aca 100644 --- a/chrome/browser/ui/cocoa/download/download_shelf_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/download/download_shelf_controller_unittest.mm @@ -2,15 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" + #import <Cocoa/Cocoa.h> +#include <utility> + #import "base/mac/scoped_block.h" #import "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/download/download_shelf.h" #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" #import "chrome/browser/ui/cocoa/download/download_item_controller.h" -#import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" #import "chrome/browser/ui/cocoa/view_resizer_pong.h" #include "content/public/test/mock_download_item.h" #include "testing/gtest/include/gtest/gtest.h" @@ -36,7 +39,7 @@ using ::testing::AnyNumber; @implementation WrappedMockDownloadItem - (id)initWithMockDownload:(scoped_ptr<content::MockDownloadItem>)download { if ((self = [super init])) { - download_ = download.Pass(); + download_ = std::move(download); } return self; } @@ -143,7 +146,8 @@ id DownloadShelfControllerTest::CreateItemController() { .WillByDefault(Return(content::DownloadItem::IN_PROGRESS)); base::scoped_nsobject<WrappedMockDownloadItem> wrappedMockDownload( - [[WrappedMockDownloadItem alloc] initWithMockDownload:download.Pass()]); + [[WrappedMockDownloadItem alloc] + initWithMockDownload:std::move(download)]); id item_controller = [OCMockObject mockForClass:[DownloadItemController class]]; diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm b/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm index c2429c41..4de33c2 100644 --- a/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm +++ b/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm @@ -5,6 +5,7 @@ #import "chrome/browser/ui/cocoa/extensions/browser_actions_container_view.h" #include <algorithm> +#include <utility> #import "chrome/browser/ui/cocoa/view_id_util.h" #include "grit/theme_resources.h" @@ -167,7 +168,7 @@ const CGFloat kMinimumContainerWidth = 3.0; - (void)setHighlight:(scoped_ptr<ui::NinePartImageIds>)highlight { if (highlight || highlight_) { - highlight_ = highlight.Pass(); + highlight_ = std::move(highlight); // We don't allow resizing when the container is highlighting. resizable_ = highlight.get() == nullptr; [self setNeedsDisplay:YES]; diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm index 71d31d7..c01b9f8 100644 --- a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm @@ -7,6 +7,7 @@ #include <stddef.h> #include <string> +#include <utility> #include "base/macros.h" #include "base/strings/sys_string_conversions.h" @@ -289,10 +290,10 @@ void ToolbarActionsBarBridge::ShowExtensionMessageBubble( extensions::ExtensionMessageBubbleController* weak_controller = bubble_controller.get(); scoped_ptr<ExtensionMessageBubbleBridge> bridge( - new ExtensionMessageBubbleBridge(bubble_controller.Pass(), + new ExtensionMessageBubbleBridge(std::move(bubble_controller), anchor_action != nullptr)); ToolbarActionsBarBubbleMac* bubble = - [controller_ createMessageBubble:bridge.Pass() + [controller_ createMessageBubble:std::move(bridge) anchorToSelf:anchor_action != nil]; weak_controller->OnShown(); [bubble showWindow:nil]; @@ -570,7 +571,7 @@ void ToolbarActionsBarBridge::ShowExtensionMessageBubble( highlight.reset( new ui::NinePartImageIds(IMAGE_GRID(IDR_DEVELOPER_MODE_HIGHLIGHT))); } - [containerView_ setHighlight:highlight.Pass()]; + [containerView_ setHighlight:std::move(highlight)]; std::vector<ToolbarActionViewController*> toolbar_actions = toolbarActionsBar_->GetActions(); @@ -812,8 +813,7 @@ void ToolbarActionsBarBridge::ShowExtensionMessageBubble( scoped_ptr<ToolbarActionsBarBubbleDelegate> delegate( new ExtensionToolbarIconSurfacingBubbleDelegate(browser_->profile())); ToolbarActionsBarBubbleMac* bubble = - [self createMessageBubble:delegate.Pass() - anchorToSelf:YES]; + [self createMessageBubble:std::move(delegate) anchorToSelf:YES]; [bubble showWindow:nil]; } [containerView_ setTrackingEnabled:NO]; @@ -1034,7 +1034,7 @@ void ToolbarActionsBarBridge::ShowExtensionMessageBubble( activeBubble_ = [[ToolbarActionsBarBubbleMac alloc] initWithParentWindow:[containerView_ window] anchorPoint:anchor - delegate:delegate.Pass()]; + delegate:std::move(delegate)]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(bubbleWindowClosing:) diff --git a/chrome/browser/ui/cocoa/extensions/extension_action_platform_delegate_cocoa.mm b/chrome/browser/ui/cocoa/extensions/extension_action_platform_delegate_cocoa.mm index 8da3f17..db8a936 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_action_platform_delegate_cocoa.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_action_platform_delegate_cocoa.mm @@ -73,7 +73,7 @@ void ExtensionActionPlatformDelegateCocoa::ShowPopup( ExtensionActionViewController::PopupShowAction show_action) { BOOL devMode = show_action == ExtensionActionViewController::SHOW_POPUP_AND_INSPECT; - [ExtensionPopupController host:host.Pass() + [ExtensionPopupController host:std::move(host) inBrowser:controller_->browser() anchoredAt:GetPopupPoint() arrowLocation:info_bubble::kTopRight diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller_browsertest.mm b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller_browsertest.mm index 2e069dd..d9068be 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller_browsertest.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller_browsertest.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.h" +#include <utility> + #include "chrome/browser/extensions/extension_install_prompt_show_params.h" #include "chrome/browser/extensions/extension_install_prompt_test_helper.h" #include "chrome/browser/ui/browser.h" @@ -37,9 +39,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionInstallDialogControllerTest, BasicTest) { chrome::BuildExtensionInstallPrompt(extension_.get()); ExtensionInstallDialogController* controller = - new ExtensionInstallDialogController(&show_params, - test_helper.GetCallback(), - prompt.Pass()); + new ExtensionInstallDialogController( + &show_params, test_helper.GetCallback(), std::move(prompt)); base::scoped_nsobject<NSWindow> window( [[[controller->view_controller() view] window] retain]); @@ -65,9 +66,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionInstallDialogControllerTest, chrome::BuildExtensionPostInstallPermissionsPrompt(extension_.get()); ExtensionInstallDialogController* controller = - new ExtensionInstallDialogController(&show_params, - test_helper.GetCallback(), - prompt.Pass()); + new ExtensionInstallDialogController( + &show_params, test_helper.GetCallback(), std::move(prompt)); base::scoped_nsobject<NSWindow> window( [[[controller->view_controller() view] window] retain]); diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_prompt_test_utils.mm b/chrome/browser/ui/cocoa/extensions/extension_install_prompt_test_utils.mm index f04a424..a7160cf 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_install_prompt_test_utils.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_install_prompt_test_utils.mm @@ -70,7 +70,7 @@ scoped_ptr<ExtensionInstallPrompt::Prompt> BuildExtensionInstallPrompt( ExtensionInstallPrompt::INSTALL_PROMPT)); prompt->set_extension(extension); prompt->set_icon(LoadInstallPromptIcon()); - return prompt.Pass(); + return prompt; } scoped_ptr<ExtensionInstallPrompt::Prompt> @@ -80,7 +80,7 @@ BuildExtensionPostInstallPermissionsPrompt(Extension* extension) { ExtensionInstallPrompt::POST_INSTALL_PERMISSIONS_PROMPT)); prompt->set_extension(extension); prompt->set_icon(LoadInstallPromptIcon()); - return prompt.Pass(); + return prompt; } } // namespace chrome diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm index 7960f53..1fe1b5d 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm @@ -6,6 +6,8 @@ #include <stddef.h> +#include <utility> + #include "base/auto_reset.h" #include "base/i18n/rtl.h" #include "base/mac/bundle_locations.h" @@ -248,7 +250,7 @@ bool HasAttribute(id item, CellAttributesMask attributeMask) { profile_ = profile; navigator_ = navigator; delegate_ = delegate; - prompt_ = prompt.Pass(); + prompt_ = std::move(prompt); warnings_.reset([[self buildWarnings:*prompt_] retain]); } return self; diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller_unittest.mm b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller_unittest.mm index 50697f4..4772c37 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller_unittest.mm @@ -2,8 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#import "chrome/browser/ui/cocoa/extensions/extension_install_view_controller.h" + #import <Cocoa/Cocoa.h> +#include <utility> + #import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" @@ -11,7 +15,6 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" #import "chrome/browser/ui/cocoa/extensions/extension_install_prompt_test_utils.h" -#import "chrome/browser/ui/cocoa/extensions/extension_install_view_controller.h" #include "extensions/common/extension.h" #include "extensions/common/permissions/permission_message_provider.h" #include "testing/gtest/include/gtest/gtest.h" @@ -84,10 +87,11 @@ TEST_F(ExtensionInstallViewControllerTest, BasicsNormalCancel) { base::string16 permissionString = prompt->GetPermission(0, type); base::scoped_nsobject<ExtensionInstallViewController> controller( - [[ExtensionInstallViewController alloc] initWithProfile:profile() - navigator:browser() - delegate:&delegate - prompt:prompt.Pass()]); + [[ExtensionInstallViewController alloc] + initWithProfile:profile() + navigator:browser() + delegate:&delegate + prompt:std::move(prompt)]); [controller view]; // Force nib load. @@ -140,10 +144,11 @@ TEST_F(ExtensionInstallViewControllerTest, BasicsNormalOK) { prompt->SetPermissions(permissions, type); base::scoped_nsobject<ExtensionInstallViewController> controller( - [[ExtensionInstallViewController alloc] initWithProfile:profile() - navigator:browser() - delegate:&delegate - prompt:prompt.Pass()]); + [[ExtensionInstallViewController alloc] + initWithProfile:profile() + navigator:browser() + delegate:&delegate + prompt:std::move(prompt)]); [controller view]; // Force nib load. [controller ok:nil]; @@ -179,7 +184,7 @@ TEST_F(ExtensionInstallViewControllerTest, MultipleWarnings) { initWithProfile:profile() navigator:browser() delegate:&delegate1 - prompt:one_warning_prompt.Pass()]); + prompt:std::move(one_warning_prompt)]); [controller1 view]; // Force nib load. @@ -188,7 +193,7 @@ TEST_F(ExtensionInstallViewControllerTest, MultipleWarnings) { initWithProfile:profile() navigator:browser() delegate:&delegate2 - prompt:two_warnings_prompt.Pass()]); + prompt:std::move(two_warnings_prompt)]); [controller2 view]; // Force nib load. @@ -216,7 +221,7 @@ TEST_F(ExtensionInstallViewControllerTest, BasicsSkinny) { initWithProfile:profile() navigator:browser() delegate:&delegate - prompt:no_warnings_prompt.Pass()]); + prompt:std::move(no_warnings_prompt)]); [controller view]; // Force nib load. @@ -262,7 +267,7 @@ TEST_F(ExtensionInstallViewControllerTest, BasicsInline) { initWithProfile:profile() navigator:browser() delegate:&delegate - prompt:inline_prompt.Pass()]); + prompt:std::move(inline_prompt)]); [controller view]; // Force nib load. @@ -320,10 +325,11 @@ TEST_F(ExtensionInstallViewControllerTest, PostInstallPermissionsPrompt) { prompt->SetPermissions(permissions, type); base::scoped_nsobject<ExtensionInstallViewController> controller( - [[ExtensionInstallViewController alloc] initWithProfile:profile() - navigator:browser() - delegate:&delegate - prompt:prompt.Pass()]); + [[ExtensionInstallViewController alloc] + initWithProfile:profile() + navigator:browser() + delegate:&delegate + prompt:std::move(prompt)]); [controller view]; // Force nib load. @@ -355,10 +361,11 @@ TEST_F(ExtensionInstallViewControllerTest, PermissionsDetails) { base::string16 permissionString = prompt->GetPermissionsDetails(0, type); base::scoped_nsobject<ExtensionInstallViewController> controller( - [[ExtensionInstallViewController alloc] initWithProfile:profile() - navigator:browser() - delegate:&delegate - prompt:prompt.Pass()]); + [[ExtensionInstallViewController alloc] + initWithProfile:profile() + navigator:browser() + delegate:&delegate + prompt:std::move(prompt)]); [controller view]; // Force nib load. diff --git a/chrome/browser/ui/cocoa/extensions/extension_message_bubble_bridge.mm b/chrome/browser/ui/cocoa/extensions/extension_message_bubble_bridge.mm index 28b77e5e..f7cb1f5 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_message_bubble_bridge.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_message_bubble_bridge.mm @@ -4,15 +4,16 @@ #include "chrome/browser/ui/cocoa/extensions/extension_message_bubble_bridge.h" +#include <utility> + #include "chrome/browser/extensions/extension_message_bubble_controller.h" #include "chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.h" ExtensionMessageBubbleBridge::ExtensionMessageBubbleBridge( scoped_ptr<extensions::ExtensionMessageBubbleController> controller, bool anchored_to_extension) - : controller_(controller.Pass()), - anchored_to_extension_(anchored_to_extension) { -} + : controller_(std::move(controller)), + anchored_to_extension_(anchored_to_extension) {} ExtensionMessageBubbleBridge::~ExtensionMessageBubbleBridge() { } diff --git a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm index d38805a..b192160 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm @@ -5,6 +5,7 @@ #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h" #include <algorithm> +#include <utility> #include "base/callback.h" #include "base/macros.h" @@ -276,7 +277,7 @@ class ExtensionPopupNotificationBridge : public content::NotificationObserver { anchoredAt:anchoredAt arrowLocation:arrowLocation devMode:devMode]; - [gPopup setExtensionViewHost:host.Pass()]; + [gPopup setExtensionViewHost:std::move(host)]; return gPopup; } diff --git a/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm b/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm index c10ea56..f9c83fd 100644 --- a/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm +++ b/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.h" +#include <utility> + #include "base/mac/foundation_util.h" #include "base/strings/sys_string_conversions.h" #import "chrome/browser/ui/cocoa/info_bubble_view.h" @@ -73,7 +75,7 @@ CGFloat kMinWidth = 320.0; parentWindow:parentWindow anchoredAt:anchorPoint])) { acknowledged_ = NO; - delegate_ = delegate.Pass(); + delegate_ = std::move(delegate); ui::NativeTheme* nativeTheme = ui::NativeThemeMac::instance(); [[self bubble] setAlignment:info_bubble::kAlignArrowToAnchor]; diff --git a/chrome/browser/ui/cocoa/extensions/windowed_install_dialog_controller.mm b/chrome/browser/ui/cocoa/extensions/windowed_install_dialog_controller.mm index ed06c87..2b2178e 100644 --- a/chrome/browser/ui/cocoa/extensions/windowed_install_dialog_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/windowed_install_dialog_controller.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/extensions/windowed_install_dialog_controller.h" +#include <utility> + #import "base/callback_helpers.h" #import "base/mac/sdk_forward_declarations.h" #include "base/message_loop/message_loop.h" @@ -39,7 +41,7 @@ WindowedInstallDialogController::WindowedInstallDialogController( initWithProfile:show_params->profile() navigator:show_params->GetParentWebContents() delegate:this - prompt:prompt.Pass()]); + prompt:std::move(prompt)]); [[install_controller_ window] makeKeyAndOrderFront:nil]; } @@ -98,7 +100,7 @@ void WindowedInstallDialogController::OnStoreLinkClicked() { initWithProfile:profile navigator:navigator delegate:delegate - prompt:prompt.Pass()]); + prompt:std::move(prompt)]); NSWindow* window = [self window]; // Ensure the window does not display behind the app launcher window, and is diff --git a/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm index 8e614fe..1259104 100644 --- a/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm @@ -6,6 +6,8 @@ #include <stddef.h> +#include <utility> + #include "base/logging.h" #include "base/strings/sys_string_conversions.h" #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" @@ -63,9 +65,9 @@ // static scoped_ptr<infobars::InfoBar> AlternateNavInfoBarDelegate::CreateInfoBar( scoped_ptr<AlternateNavInfoBarDelegate> delegate) { - scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(delegate.Pass())); + scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); base::scoped_nsobject<AlternateNavInfoBarController> controller( [[AlternateNavInfoBarController alloc] initWithInfoBar:infobar.get()]); infobar->set_controller(controller); - return infobar.Pass(); + return std::move(infobar); } diff --git a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm index aa5478d..bf5642c 100644 --- a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm @@ -4,6 +4,8 @@ #include "chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.h" +#include <utility> + #include "base/logging.h" #include "base/strings/sys_string_conversions.h" #include "chrome/browser/infobars/infobar_service.h" @@ -147,9 +149,9 @@ scoped_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate> delegate) { - scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(delegate.Pass())); + scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); base::scoped_nsobject<ConfirmInfoBarController> controller( [[ConfirmInfoBarController alloc] initWithInfoBar:infobar.get()]); infobar->set_controller(controller); - return infobar.Pass(); + return std::move(infobar); } diff --git a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller_unittest.mm b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller_unittest.mm index a14305a..93de71a 100644 --- a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller_unittest.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.h" +#include <utility> + #include "base/mac/scoped_nsobject.h" #include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" @@ -93,7 +95,7 @@ class ConfirmInfoBarControllerTest : public CocoaProfileTest, scoped_ptr<infobars::InfoBarDelegate> delegate( new MockConfirmInfoBarDelegate(this)); - infobar_ = new InfoBarCocoa(delegate.Pass()); + infobar_ = new InfoBarCocoa(std::move(delegate)); infobar_->SetOwner(InfoBarService::FromWebContents(web_contents_.get())); controller_.reset([[TestConfirmInfoBarController alloc] diff --git a/chrome/browser/ui/cocoa/infobars/infobar_cocoa.mm b/chrome/browser/ui/cocoa/infobars/infobar_cocoa.mm index c3183a1..11753ba 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_cocoa.mm +++ b/chrome/browser/ui/cocoa/infobars/infobar_cocoa.mm @@ -4,12 +4,12 @@ #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" +#include <utility> + #import "chrome/browser/ui/cocoa/infobars/infobar_controller.h" InfoBarCocoa::InfoBarCocoa(scoped_ptr<infobars::InfoBarDelegate> delegate) - : infobars::InfoBar(delegate.Pass()), - weak_ptr_factory_(this) { -} + : infobars::InfoBar(std::move(delegate)), weak_ptr_factory_(this) {} InfoBarCocoa::~InfoBarCocoa() { if (controller()) diff --git a/chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm b/chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm index c91e123..6de886a 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm @@ -6,6 +6,8 @@ #import <Cocoa/Cocoa.h> +#include <utility> + #include "base/mac/scoped_nsobject.h" #include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" @@ -62,7 +64,8 @@ TEST_F(InfoBarContainerControllerTest, AddAndRemoveInfoBars) { scoped_ptr<infobars::InfoBarDelegate> confirm_delegate( new MockConfirmInfoBarDelegate(NULL)); - scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(confirm_delegate.Pass())); + scoped_ptr<InfoBarCocoa> infobar( + new InfoBarCocoa(std::move(confirm_delegate))); base::scoped_nsobject<ConfirmInfoBarController> controller( [[ConfirmInfoBarController alloc] initWithInfoBar:infobar.get()]); infobar->set_controller(controller); diff --git a/chrome/browser/ui/cocoa/infobars/save_password_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/save_password_infobar_controller.mm index 005e00a..aa3ecf9 100644 --- a/chrome/browser/ui/cocoa/infobars/save_password_infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/save_password_infobar_controller.mm @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <utility> + #include "chrome/browser/password_manager/save_password_infobar_delegate.h" #include "chrome/browser/ui/chrome_style.h" #include "chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.h" @@ -31,11 +33,11 @@ scoped_ptr<infobars::InfoBar> CreateSavePasswordInfoBar (scoped_ptr<SavePasswordInfoBarDelegate> delegate) { - scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(delegate.Pass())); + scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); base::scoped_nsobject<SavePasswordInfobarController> controller( [[SavePasswordInfobarController alloc] initWithInfoBar:infobar.get()]); infobar->set_controller(controller); - return infobar.Pass(); + return std::move(infobar); } @end diff --git a/chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm b/chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm index 14fce73..2bdc727 100644 --- a/chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm +++ b/chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm @@ -6,6 +6,8 @@ #include <stddef.h> +#include <utility> + #include "base/logging.h" #include "base/strings/sys_string_conversions.h" #include "chrome/app/chrome_command_ids.h" @@ -32,7 +34,7 @@ using InfoBarUtilities::AddMenuItem; scoped_ptr<infobars::InfoBar> ChromeTranslateClient::CreateInfoBar( scoped_ptr<translate::TranslateInfoBarDelegate> delegate) const { - scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(delegate.Pass())); + scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); base::scoped_nsobject<TranslateInfoBarControllerBase> infobar_controller; switch (infobar->delegate()->AsTranslateInfoBarDelegate()->translate_step()) { case translate::TRANSLATE_STEP_BEFORE_TRANSLATE: @@ -52,7 +54,7 @@ scoped_ptr<infobars::InfoBar> ChromeTranslateClient::CreateInfoBar( NOTREACHED(); } infobar->set_controller(infobar_controller); - return infobar.Pass(); + return std::move(infobar); } @implementation TranslateInfoBarControllerBase (FrameChangeObserver) diff --git a/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm b/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm index aef043b..475c511 100644 --- a/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm +++ b/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm @@ -5,6 +5,8 @@ #import <Cocoa/Cocoa.h> #include <stddef.h> +#include <utility> + #import "base/mac/scoped_nsobject.h" #include "base/macros.h" #import "base/strings/string_util.h" @@ -104,7 +106,7 @@ class TranslationInfoBarTest : public CocoaProfileTest { scoped_ptr<translate::TranslateInfoBarDelegate> delegate( new MockTranslateInfoBarDelegate(web_contents_.get(), type, error)); scoped_ptr<infobars::InfoBar> infobar( - chrome_translate_client->CreateInfoBar(delegate.Pass())); + chrome_translate_client->CreateInfoBar(std::move(delegate))); if (infobar_) infobar_->CloseSoon(); infobar_ = static_cast<InfoBarCocoa*>(infobar.release()); diff --git a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.mm b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.mm index 8708f3a..d8d4a3e 100644 --- a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.mm +++ b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.mm @@ -4,6 +4,8 @@ #include "chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.h" +#include <utility> + #import "chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.h" DesktopMediaPickerCocoa::DesktopMediaPickerCocoa() { @@ -19,12 +21,12 @@ void DesktopMediaPickerCocoa::Show(content::WebContents* web_contents, const base::string16& target_name, scoped_ptr<DesktopMediaList> media_list, const DoneCallback& done_callback) { - controller_.reset( - [[DesktopMediaPickerController alloc] initWithMediaList:media_list.Pass() - parent:parent - callback:done_callback - appName:app_name - targetName:target_name]); + controller_.reset([[DesktopMediaPickerController alloc] + initWithMediaList:std::move(media_list) + parent:parent + callback:done_callback + appName:app_name + targetName:target_name]); [controller_ showWindow:nil]; } diff --git a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm index 488f547..80cc9cb 100644 --- a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm +++ b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.h" +#include <utility> + #include "base/bind.h" #include "base/command_line.h" #import "base/mac/bundle_locations.h" @@ -75,7 +77,7 @@ const int kExcessButtonPadding = 6; [parent addChildWindow:window ordered:NSWindowAbove]; [window setDelegate:self]; [self initializeContentsWithAppName:appName targetName:targetName]; - media_list_ = media_list.Pass(); + media_list_ = std::move(media_list); media_list_->SetViewDialogWindowId(content::DesktopMediaID( content::DesktopMediaID::TYPE_WINDOW, [window windowNumber])); doneCallback_ = callback; diff --git a/chrome/browser/ui/cocoa/passwords/account_avatar_fetcher_manager.mm b/chrome/browser/ui/cocoa/passwords/account_avatar_fetcher_manager.mm index 618b782..b475b24 100644 --- a/chrome/browser/ui/cocoa/passwords/account_avatar_fetcher_manager.mm +++ b/chrome/browser/ui/cocoa/passwords/account_avatar_fetcher_manager.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/passwords/account_avatar_fetcher_manager.h" +#include <utility> + #include "base/memory/weak_ptr.h" #import "chrome/browser/ui/cocoa/passwords/credential_item_view.h" #include "chrome/browser/ui/passwords/account_avatar_fetcher.h" @@ -69,7 +71,7 @@ void AccountAvatarFetcherBridge::UpdateAvatar(const gfx::ImageSkia& image) { new AccountAvatarFetcherBridge(self, view)); AccountAvatarFetcher* fetcher = new AccountAvatarFetcher(avatarURL, bridge->AsWeakPtr()); - bridges_.push_back(bridge.Pass()); + bridges_.push_back(std::move(bridge)); [self startRequestWithFetcher:fetcher]; } diff --git a/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller_unittest.mm b/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller_unittest.mm index e8bbc0a..b9c747d 100644 --- a/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller_unittest.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.h" +#include <utility> + #include "base/mac/foundation_util.h" #include "base/memory/scoped_vector.h" #include "base/strings/string16.h" @@ -57,7 +59,7 @@ namespace { scoped_ptr<autofill::PasswordForm> Credential(const char* username) { scoped_ptr<autofill::PasswordForm> credential(new autofill::PasswordForm); credential->username_value = base::ASCIIToUTF16(username); - return credential.Pass(); + return credential; } // Tests for the account chooser view of the password management bubble. @@ -102,7 +104,7 @@ TEST_F(ManagePasswordsBubbleAccountChooserViewControllerTest, ConfiguresViews) { local_forms.push_back(Credential("pizza")); ScopedVector<const autofill::PasswordForm> federated_forms; federated_forms.push_back(Credential("taco")); - SetUpAccountChooser(local_forms.Pass(), federated_forms.Pass()); + SetUpAccountChooser(std::move(local_forms), std::move(federated_forms)); // Trigger creation of controller and check the views. NSTableView* view = controller().credentialsView; ASSERT_NSNE(nil, view); @@ -127,8 +129,8 @@ TEST_F(ManagePasswordsBubbleAccountChooserViewControllerTest, ScopedVector<const autofill::PasswordForm> local_forms; scoped_ptr<autofill::PasswordForm> form = Credential("taco"); form->icon_url = GURL("http://foo"); - local_forms.push_back(form.Pass()); - SetUpAccountChooser(local_forms.Pass(), + local_forms.push_back(std::move(form)); + SetUpAccountChooser(std::move(local_forms), ScopedVector<const autofill::PasswordForm>()); // Trigger creation of the controller and check the fetched URLs. controller(); @@ -145,7 +147,7 @@ TEST_F(ManagePasswordsBubbleAccountChooserViewControllerTest, local_forms.push_back(Credential("pizza")); ScopedVector<const autofill::PasswordForm> federated_forms; federated_forms.push_back(Credential("taco")); - SetUpAccountChooser(local_forms.Pass(), federated_forms.Pass()); + SetUpAccountChooser(std::move(local_forms), std::move(federated_forms)); EXPECT_CALL(*ui_controller(), ChooseCredential( *Credential("taco"), @@ -160,7 +162,7 @@ TEST_F(ManagePasswordsBubbleAccountChooserViewControllerTest, SelectingNopeDismissesDialog) { ScopedVector<const autofill::PasswordForm> local_forms; local_forms.push_back(Credential("pizza")); - SetUpAccountChooser(local_forms.Pass(), + SetUpAccountChooser(std::move(local_forms), ScopedVector<const autofill::PasswordForm>()); [controller().cancelButton performClick:nil]; EXPECT_TRUE(delegate().dismissed); diff --git a/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac.mm b/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac.mm index 26ceb2f..dafc7c2 100644 --- a/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac.mm +++ b/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac.mm @@ -4,6 +4,8 @@ #include "chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac.h" +#include <utility> + #include "base/compiler_specific.h" #import "base/mac/scoped_sending_event.h" #include "base/macros.h" @@ -88,7 +90,7 @@ RenderViewContextMenuMac::RenderViewContextMenuMac( bidi_submenu_model_(this), parent_view_(parent_view) { scoped_ptr<ToolkitDelegate> delegate(new ToolkitDelegateMac(this)); - set_toolkit_delegate(delegate.Pass()); + set_toolkit_delegate(std::move(delegate)); } RenderViewContextMenuMac::~RenderViewContextMenuMac() { diff --git a/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm b/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm index 5df6b12..8c7d66d 100644 --- a/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm +++ b/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm @@ -7,6 +7,8 @@ #import <SecurityInterface/SFChooseIdentityPanel.h> #include <stddef.h> +#include <utility> + #include "base/logging.h" #include "base/mac/foundation_util.h" #include "base/strings/string_util.h" @@ -51,7 +53,7 @@ class SSLClientAuthObserverCocoaBridge : public SSLClientAuthObserver, SSLClientCertificateSelectorCocoa* controller) : SSLClientAuthObserver(browser_context, cert_request_info, - delegate.Pass()), + std::move(delegate)), controller_(controller) {} // SSLClientAuthObserver implementation: @@ -97,7 +99,7 @@ void ShowSSLClientCertificateSelector( [[SSLClientCertificateSelectorCocoa alloc] initWithBrowserContext:contents->GetBrowserContext() certRequestInfo:cert_request_info - delegate:delegate.Pass()]; + delegate:std::move(delegate)]; [selector displayForWebContents:contents]; } @@ -113,7 +115,7 @@ void ShowSSLClientCertificateSelector( DCHECK(certRequestInfo); if ((self = [super init])) { observer_.reset(new SSLClientAuthObserverCocoaBridge( - browserContext, certRequestInfo, delegate.Pass(), self)); + browserContext, certRequestInfo, std::move(delegate), self)); } return self; } diff --git a/chrome/browser/ui/cocoa/tab_contents/chrome_web_contents_view_delegate_mac.mm b/chrome/browser/ui/cocoa/tab_contents/chrome_web_contents_view_delegate_mac.mm index 81a6648..983ae52 100644 --- a/chrome/browser/ui/cocoa/tab_contents/chrome_web_contents_view_delegate_mac.mm +++ b/chrome/browser/ui/cocoa/tab_contents/chrome_web_contents_view_delegate_mac.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/tab_contents/chrome_web_contents_view_delegate_mac.h" +#include <utility> + #include "base/profiler/scoped_tracker.h" #import "chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.h" #include "chrome/browser/ui/browser.h" @@ -61,7 +63,7 @@ void ChromeWebContentsViewDelegateMac::ShowMenu( FROM_HERE_WITH_EXPLICIT_FUNCTION( "458401 ChromeWebContentsViewDelegateMac::ShowMenu")); - context_menu_ = menu.Pass(); + context_menu_ = std::move(menu); if (!context_menu_.get()) return; @@ -113,7 +115,7 @@ ChromeWebContentsViewDelegateMac::BuildMenu( menu->Init(); } - return menu.Pass(); + return menu; } content::RenderWidgetHostView* diff --git a/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.mm b/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.mm index abddcf9..6935ce1 100644 --- a/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.mm +++ b/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.mm @@ -4,6 +4,8 @@ #include "chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h" +#include <utility> + #include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/browser_dialogs.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h" @@ -120,7 +122,7 @@ void TabModalConfirmDialogMac::OnConstrainedWindowClosed( // prevent a double-delete by moving delegate_ to a stack variable. if (!delegate_) return; - scoped_ptr<TabModalConfirmDialogDelegate> delegate(delegate_.Pass()); + scoped_ptr<TabModalConfirmDialogDelegate> delegate(std::move(delegate_)); // Provide a disposition in case the dialog was closed without accepting or // cancelling. delegate->Close(); diff --git a/chrome/browser/ui/cocoa/translate/translate_bubble_controller.mm b/chrome/browser/ui/cocoa/translate/translate_bubble_controller.mm index 8fbcdbe..975b0b3 100644 --- a/chrome/browser/ui/cocoa/translate/translate_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/translate/translate_bubble_controller.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/translate/translate_bubble_controller.h" +#include <utility> + #include "base/mac/foundation_util.h" #include "base/mac/scoped_nsobject.h" #include "base/macros.h" @@ -124,7 +126,7 @@ const CGFloat kContentWidth = kWindowWidth - 2 * kFramePadding; parentWindow:parentWindow anchoredAt:NSZeroPoint])) { webContents_ = webContents; - model_ = model.Pass(); + model_ = std::move(model); if (model_->GetViewState() != TranslateBubbleModel::VIEW_STATE_BEFORE_TRANSLATE) { translateExecuted_ = YES; |