OLD | NEW |
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> | 5 #include <utility> |
6 | 6 |
7 #include "chrome/browser/password_manager/save_password_infobar_delegate.h" | 7 #include "chrome/browser/password_manager/save_password_infobar_delegate.h" |
8 #include "chrome/browser/ui/chrome_style.h" | 8 #include "chrome/browser/ui/chrome_style.h" |
9 #include "chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.h" | 9 #include "chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.h" |
10 #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" | 10 #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 static_cast<SavePasswordInfoBarDelegate*>([self delegate]); | 24 static_cast<SavePasswordInfoBarDelegate*>([self delegate]); |
25 gfx::Range linkRange = delegate->message_link_range(); | 25 gfx::Range linkRange = delegate->message_link_range(); |
26 if (!linkRange.is_empty()) { | 26 if (!linkRange.is_empty()) { |
27 NSColor* linkColor = | 27 NSColor* linkColor = |
28 skia::SkColorToCalibratedNSColor(chrome_style::GetLinkColor()); | 28 skia::SkColorToCalibratedNSColor(chrome_style::GetLinkColor()); |
29 HyperlinkTextView* view = (HyperlinkTextView*)label_.get(); | 29 HyperlinkTextView* view = (HyperlinkTextView*)label_.get(); |
30 [view addLinkRange:linkRange.ToNSRange() withURL:nil linkColor:linkColor]; | 30 [view addLinkRange:linkRange.ToNSRange() withURL:nil linkColor:linkColor]; |
31 } | 31 } |
32 } | 32 } |
33 | 33 |
34 scoped_ptr<infobars::InfoBar> CreateSavePasswordInfoBar | 34 std::unique_ptr<infobars::InfoBar> CreateSavePasswordInfoBar( |
35 (scoped_ptr<SavePasswordInfoBarDelegate> delegate) { | 35 std::unique_ptr<SavePasswordInfoBarDelegate> delegate) { |
36 scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); | 36 std::unique_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); |
37 base::scoped_nsobject<SavePasswordInfobarController> controller( | 37 base::scoped_nsobject<SavePasswordInfobarController> controller( |
38 [[SavePasswordInfobarController alloc] initWithInfoBar:infobar.get()]); | 38 [[SavePasswordInfobarController alloc] initWithInfoBar:infobar.get()]); |
39 infobar->set_controller(controller); | 39 infobar->set_controller(controller); |
40 return std::move(infobar); | 40 return std::move(infobar); |
41 } | 41 } |
42 | 42 |
43 @end | 43 @end |
OLD | NEW |