OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/infobars/infobar_service.h" | 5 #include "chrome/browser/infobars/infobar_service.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/infobars/insecure_content_infobar_delegate.h" | 9 #include "chrome/browser/infobars/insecure_content_infobar_delegate.h" |
10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 InfoBarService::~InfoBarService() { | 67 InfoBarService::~InfoBarService() { |
68 ShutDown(); | 68 ShutDown(); |
69 } | 69 } |
70 | 70 |
71 int InfoBarService::GetActiveEntryID() { | 71 int InfoBarService::GetActiveEntryID() { |
72 content::NavigationEntry* active_entry = | 72 content::NavigationEntry* active_entry = |
73 web_contents()->GetController().GetActiveEntry(); | 73 web_contents()->GetController().GetActiveEntry(); |
74 return active_entry ? active_entry->GetUniqueID() : 0; | 74 return active_entry ? active_entry->GetUniqueID() : 0; |
75 } | 75 } |
76 | 76 |
| 77 const infobars::InfoBarConstants& InfoBarService::GetInfoBarConstants() const { |
| 78 return kChromeInfoBarConstants; |
| 79 } |
| 80 |
77 void InfoBarService::NotifyInfoBarAdded(InfoBar* infobar) { | 81 void InfoBarService::NotifyInfoBarAdded(InfoBar* infobar) { |
78 InfoBarManager::NotifyInfoBarAdded(infobar); | 82 InfoBarManager::NotifyInfoBarAdded(infobar); |
79 // TODO(droger): Remove the notifications and have listeners change to be | 83 // TODO(droger): Remove the notifications and have listeners change to be |
80 // InfoBarManager::Observers instead. See http://crbug.com/354380 | 84 // InfoBarManager::Observers instead. See http://crbug.com/354380 |
81 content::NotificationService::current()->Notify( | 85 content::NotificationService::current()->Notify( |
82 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, | 86 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, |
83 content::Source<InfoBarService>(this), | 87 content::Source<InfoBarService>(this), |
84 content::Details<InfoBar::AddedDetails>(infobar)); | 88 content::Details<InfoBar::AddedDetails>(infobar)); |
85 } | 89 } |
86 | 90 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 140 |
137 void InfoBarService::OnDidBlockDisplayingInsecureContent() { | 141 void InfoBarService::OnDidBlockDisplayingInsecureContent() { |
138 InsecureContentInfoBarDelegate::Create( | 142 InsecureContentInfoBarDelegate::Create( |
139 this, InsecureContentInfoBarDelegate::DISPLAY); | 143 this, InsecureContentInfoBarDelegate::DISPLAY); |
140 } | 144 } |
141 | 145 |
142 void InfoBarService::OnDidBlockRunningInsecureContent() { | 146 void InfoBarService::OnDidBlockRunningInsecureContent() { |
143 InsecureContentInfoBarDelegate::Create(this, | 147 InsecureContentInfoBarDelegate::Create(this, |
144 InsecureContentInfoBarDelegate::RUN); | 148 InsecureContentInfoBarDelegate::RUN); |
145 } | 149 } |
OLD | NEW |