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

Side by Side Diff: chrome/browser/ui/cocoa/infobars/save_password_infobar_controller.mm

Issue 1579863003: Convert Pass()→std::move() for Mac build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <utility>
6
5 #include "chrome/browser/password_manager/save_password_infobar_delegate.h" 7 #include "chrome/browser/password_manager/save_password_infobar_delegate.h"
6 #include "chrome/browser/ui/chrome_style.h" 8 #include "chrome/browser/ui/chrome_style.h"
7 #include "chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.h" 9 #include "chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.h"
8 #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" 10 #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h"
9 #include "components/infobars/core/infobar.h" 11 #include "components/infobars/core/infobar.h"
10 #include "skia/ext/skia_utils_mac.h" 12 #include "skia/ext/skia_utils_mac.h"
11 #include "ui/base/cocoa/controls/hyperlink_text_view.h" 13 #include "ui/base/cocoa/controls/hyperlink_text_view.h"
12 14
13 @interface SavePasswordInfobarController : ConfirmInfoBarController 15 @interface SavePasswordInfobarController : ConfirmInfoBarController
14 @end 16 @end
15 17
16 @implementation SavePasswordInfobarController 18 @implementation SavePasswordInfobarController
17 19
18 - (void)addAdditionalControls { 20 - (void)addAdditionalControls {
19 [super addAdditionalControls]; 21 [super addAdditionalControls];
20 // Set the link inside the message. 22 // Set the link inside the message.
21 SavePasswordInfoBarDelegate* delegate = 23 SavePasswordInfoBarDelegate* delegate =
22 static_cast<SavePasswordInfoBarDelegate*>([self delegate]); 24 static_cast<SavePasswordInfoBarDelegate*>([self delegate]);
23 gfx::Range linkRange = delegate->message_link_range(); 25 gfx::Range linkRange = delegate->message_link_range();
24 if (!linkRange.is_empty()) { 26 if (!linkRange.is_empty()) {
25 NSColor* linkColor = 27 NSColor* linkColor =
26 skia::SkColorToCalibratedNSColor(chrome_style::GetLinkColor()); 28 skia::SkColorToCalibratedNSColor(chrome_style::GetLinkColor());
27 HyperlinkTextView* view = (HyperlinkTextView*)label_.get(); 29 HyperlinkTextView* view = (HyperlinkTextView*)label_.get();
28 [view addLinkRange:linkRange.ToNSRange() withURL:nil linkColor:linkColor]; 30 [view addLinkRange:linkRange.ToNSRange() withURL:nil linkColor:linkColor];
29 } 31 }
30 } 32 }
31 33
32 scoped_ptr<infobars::InfoBar> CreateSavePasswordInfoBar 34 scoped_ptr<infobars::InfoBar> CreateSavePasswordInfoBar
33 (scoped_ptr<SavePasswordInfoBarDelegate> delegate) { 35 (scoped_ptr<SavePasswordInfoBarDelegate> delegate) {
34 scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(delegate.Pass())); 36 scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate)));
35 base::scoped_nsobject<SavePasswordInfobarController> controller( 37 base::scoped_nsobject<SavePasswordInfobarController> controller(
36 [[SavePasswordInfobarController alloc] initWithInfoBar:infobar.get()]); 38 [[SavePasswordInfobarController alloc] initWithInfoBar:infobar.get()]);
37 infobar->set_controller(controller); 39 infobar->set_controller(controller);
38 return infobar.Pass(); 40 return std::move(infobar);
39 } 41 }
40 42
41 @end 43 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698