OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_win.h" | 5 #include "chrome/browser/ui/views/collected_cookies_win.h" |
6 | 6 |
7 #include "chrome/browser/content_settings/host_content_settings_map.h" | 7 #include "chrome/browser/content_settings/host_content_settings_map.h" |
8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
9 #include "chrome/browser/cookies_tree_model.h" | 9 #include "chrome/browser/cookies_tree_model.h" |
| 10 #include "chrome/browser/infobars/infobar_tab_helper.h" |
10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" | 12 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" |
12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
13 #include "chrome/browser/ui/views/constrained_window_views.h" | 14 #include "chrome/browser/ui/views/constrained_window_views.h" |
14 #include "chrome/browser/ui/views/cookie_info_view.h" | 15 #include "chrome/browser/ui/views/cookie_info_view.h" |
15 #include "chrome/common/chrome_notification_types.h" | 16 #include "chrome/common/chrome_notification_types.h" |
16 #include "content/common/notification_details.h" | 17 #include "content/common/notification_details.h" |
17 #include "content/common/notification_source.h" | 18 #include "content/common/notification_source.h" |
18 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
19 #include "grit/locale_settings.h" | 20 #include "grit/locale_settings.h" |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 MessageBoxFlags::DialogButton button) const { | 372 MessageBoxFlags::DialogButton button) const { |
372 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_CLOSE)); | 373 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_CLOSE)); |
373 } | 374 } |
374 | 375 |
375 void CollectedCookiesWin::DeleteDelegate() { | 376 void CollectedCookiesWin::DeleteDelegate() { |
376 delete this; | 377 delete this; |
377 } | 378 } |
378 | 379 |
379 bool CollectedCookiesWin::Cancel() { | 380 bool CollectedCookiesWin::Cancel() { |
380 if (status_changed_) { | 381 if (status_changed_) { |
381 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_)->AddInfoBar( | 382 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_)-> |
382 new CollectedCookiesInfoBarDelegate(tab_contents_)); | 383 infobar_tab_helper()->AddInfoBar( |
| 384 new CollectedCookiesInfoBarDelegate(tab_contents_)); |
383 } | 385 } |
384 | 386 |
385 return true; | 387 return true; |
386 } | 388 } |
387 | 389 |
388 views::View* CollectedCookiesWin::GetContentsView() { | 390 views::View* CollectedCookiesWin::GetContentsView() { |
389 return this; | 391 return this; |
390 } | 392 } |
391 | 393 |
392 views::Widget* CollectedCookiesWin::GetWidget() { | 394 views::Widget* CollectedCookiesWin::GetWidget() { |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 | 505 |
504 /////////////////////////////////////////////////////////////////////////////// | 506 /////////////////////////////////////////////////////////////////////////////// |
505 // NotificationObserver implementation. | 507 // NotificationObserver implementation. |
506 | 508 |
507 void CollectedCookiesWin::Observe(int type, | 509 void CollectedCookiesWin::Observe(int type, |
508 const NotificationSource& source, | 510 const NotificationSource& source, |
509 const NotificationDetails& details) { | 511 const NotificationDetails& details) { |
510 DCHECK(type == chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN); | 512 DCHECK(type == chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN); |
511 window_->CloseConstrainedWindow(); | 513 window_->CloseConstrainedWindow(); |
512 } | 514 } |
OLD | NEW |