blob: 11753babbd6a6ee3cea98a0f0ae4941d56e234f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#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(std::move(delegate)), weak_ptr_factory_(this) {}
InfoBarCocoa::~InfoBarCocoa() {
if (controller())
[controller() infobarWillClose];
}
infobars::InfoBarManager* InfoBarCocoa::OwnerCocoa() { return owner(); }
base::WeakPtr<InfoBarCocoa> InfoBarCocoa::GetWeakPtr() {
return weak_ptr_factory_.GetWeakPtr();
}
|