OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/ui/views/collected_cookies_views.h" | 5 #include "chrome/browser/ui/views/collected_cookies_views.h" |
6 | 6 |
7 #include "chrome/browser/api/infobars/infobar_service.h" | 7 #include "chrome/browser/api/infobars/infobar_service.h" |
8 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h" | 8 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h" |
9 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" | 9 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" |
10 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" | 10 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 ui::DialogButton button) const { | 216 ui::DialogButton button) const { |
217 return l10n_util::GetStringUTF16(IDS_CLOSE); | 217 return l10n_util::GetStringUTF16(IDS_CLOSE); |
218 } | 218 } |
219 | 219 |
220 void CollectedCookiesViews::DeleteDelegate() { | 220 void CollectedCookiesViews::DeleteDelegate() { |
221 delete this; | 221 delete this; |
222 } | 222 } |
223 | 223 |
224 bool CollectedCookiesViews::Cancel() { | 224 bool CollectedCookiesViews::Cancel() { |
225 if (status_changed_) { | 225 if (status_changed_) { |
226 InfoBarService* infobar_service = | 226 CollectedCookiesInfoBarDelegate::Create( |
227 InfoBarService::FromWebContents(web_contents_); | 227 InfoBarService::FromWebContents(web_contents_)); |
228 infobar_service->AddInfoBar( | |
229 new CollectedCookiesInfoBarDelegate(infobar_service)); | |
230 } | 228 } |
231 | 229 |
232 return true; | 230 return true; |
233 } | 231 } |
234 | 232 |
235 ui::ModalType CollectedCookiesViews::GetModalType() const { | 233 ui::ModalType CollectedCookiesViews::GetModalType() const { |
236 #if defined(USE_ASH) | 234 #if defined(USE_ASH) |
237 return ui::MODAL_TYPE_CHILD; | 235 return ui::MODAL_TYPE_CHILD; |
238 #else | 236 #else |
239 return views::WidgetDelegate::GetModalType(); | 237 return views::WidgetDelegate::GetModalType(); |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 /////////////////////////////////////////////////////////////////////////////// | 521 /////////////////////////////////////////////////////////////////////////////// |
524 // CollectedCookiesViews, content::NotificationObserver implementation: | 522 // CollectedCookiesViews, content::NotificationObserver implementation: |
525 | 523 |
526 void CollectedCookiesViews::Observe( | 524 void CollectedCookiesViews::Observe( |
527 int type, | 525 int type, |
528 const content::NotificationSource& source, | 526 const content::NotificationSource& source, |
529 const content::NotificationDetails& details) { | 527 const content::NotificationDetails& details) { |
530 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); | 528 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); |
531 window_->CloseWebContentsModalDialog(); | 529 window_->CloseWebContentsModalDialog(); |
532 } | 530 } |
OLD | NEW |