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

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

Issue 1978563002: Stop compiling password infobar code on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clean up cocoa Created 4 years, 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <utility>
6
7 #include "chrome/browser/password_manager/save_password_infobar_delegate.h"
8 #include "chrome/browser/ui/chrome_style.h"
9 #include "chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.h"
10 #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h"
11 #include "components/infobars/core/infobar.h"
12 #include "skia/ext/skia_utils_mac.h"
13 #include "ui/base/cocoa/controls/hyperlink_text_view.h"
14
15 @interface SavePasswordInfobarController : ConfirmInfoBarController
16 @end
17
18 @implementation SavePasswordInfobarController
19
20 - (void)addAdditionalControls {
21 [super addAdditionalControls];
22 // Set the link inside the message.
23 SavePasswordInfoBarDelegate* delegate =
24 static_cast<SavePasswordInfoBarDelegate*>([self delegate]);
25 gfx::Range linkRange = delegate->message_link_range();
26 if (!linkRange.is_empty()) {
27 NSColor* linkColor =
28 skia::SkColorToCalibratedNSColor(chrome_style::GetLinkColor());
29 HyperlinkTextView* view = (HyperlinkTextView*)label_.get();
30 [view addLinkRange:linkRange.ToNSRange() withURL:nil linkColor:linkColor];
31 }
32 }
33
34 std::unique_ptr<infobars::InfoBar> CreateSavePasswordInfoBar(
35 std::unique_ptr<SavePasswordInfoBarDelegate> delegate) {
36 std::unique_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate)));
37 base::scoped_nsobject<SavePasswordInfobarController> controller(
38 [[SavePasswordInfobarController alloc] initWithInfoBar:infobar.get()]);
39 infobar->set_controller(controller);
40 return std::move(infobar);
41 }
42
43 @end
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/password_manager_test_base.cc ('k') | chrome/browser/ui/views/infobars/legacy_infobars_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698