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

Side by Side Diff: chrome/browser/infobars/infobar_delegate.cc

Issue 240193003: Move Infobars core files to the Infobars component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nib name on mac Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/infobars/infobar_delegate.h ('k') | chrome/browser/infobars/infobar_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 "chrome/browser/infobars/infobar_delegate.h"
6
7 #include "base/logging.h"
8 #include "build/build_config.h"
9 #include "chrome/browser/infobars/infobar.h"
10 #include "chrome/browser/infobars/infobar_manager.h"
11 #include "ui/base/resource/resource_bundle.h"
12
13 const int InfoBarDelegate::kNoIconID = 0;
14
15 InfoBarDelegate::~InfoBarDelegate() {
16 }
17
18 InfoBarDelegate::InfoBarAutomationType
19 InfoBarDelegate::GetInfoBarAutomationType() const {
20 return UNKNOWN_INFOBAR;
21 }
22
23 bool InfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const {
24 return false;
25 }
26
27 bool InfoBarDelegate::ShouldExpire(const NavigationDetails& details) const {
28 if (!details.is_navigation_to_different_page)
29 return false;
30
31 return ShouldExpireInternal(details);
32 }
33
34 void InfoBarDelegate::InfoBarDismissed() {
35 }
36
37 int InfoBarDelegate::GetIconID() const {
38 return kNoIconID;
39 }
40
41 InfoBarDelegate::Type InfoBarDelegate::GetInfoBarType() const {
42 return WARNING_TYPE;
43 }
44
45 AutoLoginInfoBarDelegate* InfoBarDelegate::AsAutoLoginInfoBarDelegate() {
46 return NULL;
47 }
48
49 ConfirmInfoBarDelegate* InfoBarDelegate::AsConfirmInfoBarDelegate() {
50 return NULL;
51 }
52
53 ExtensionInfoBarDelegate* InfoBarDelegate::AsExtensionInfoBarDelegate() {
54 return NULL;
55 }
56
57 InsecureContentInfoBarDelegate*
58 InfoBarDelegate::AsInsecureContentInfoBarDelegate() {
59 return NULL;
60 }
61
62 MediaStreamInfoBarDelegate* InfoBarDelegate::AsMediaStreamInfoBarDelegate() {
63 return NULL;
64 }
65
66 PopupBlockedInfoBarDelegate* InfoBarDelegate::AsPopupBlockedInfoBarDelegate() {
67 return NULL;
68 }
69
70 RegisterProtocolHandlerInfoBarDelegate*
71 InfoBarDelegate::AsRegisterProtocolHandlerInfoBarDelegate() {
72 return NULL;
73 }
74
75 ScreenCaptureInfoBarDelegate*
76 InfoBarDelegate::AsScreenCaptureInfoBarDelegate() {
77 return NULL;
78 }
79
80 ThemeInstalledInfoBarDelegate*
81 InfoBarDelegate::AsThemePreviewInfobarDelegate() {
82 return NULL;
83 }
84
85 TranslateInfoBarDelegate* InfoBarDelegate::AsTranslateInfoBarDelegate() {
86 return NULL;
87 }
88
89 void InfoBarDelegate::StoreActiveEntryUniqueID() {
90 contents_unique_id_ = infobar()->owner()->GetActiveEntryID();
91 }
92
93 gfx::Image InfoBarDelegate::GetIcon() const {
94 int icon_id = GetIconID();
95 return (icon_id == kNoIconID) ? gfx::Image() :
96 ResourceBundle::GetSharedInstance().GetNativeImageNamed(icon_id);
97 }
98
99 InfoBarDelegate::InfoBarDelegate() : contents_unique_id_(0) {
100 }
101
102 bool InfoBarDelegate::ShouldExpireInternal(
103 const NavigationDetails& details) const {
104 // NOTE: If you change this, be sure to check and adjust the behavior of
105 // anyone who overrides this as necessary!
106 return (contents_unique_id_ != details.entry_id) || details.is_reload;
107 }
OLDNEW
« no previous file with comments | « chrome/browser/infobars/infobar_delegate.h ('k') | chrome/browser/infobars/infobar_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698