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 "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_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" |
11 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" | 11 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" |
12 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" | 12 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" |
13 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" | 13 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" |
14 #include "chrome/browser/browsing_data/browsing_data_server_bound_cert_helper.h" | 14 #include "chrome/browser/browsing_data/browsing_data_server_bound_cert_helper.h" |
15 #include "chrome/browser/browsing_data/cookies_tree_model.h" | 15 #include "chrome/browser/browsing_data/cookies_tree_model.h" |
16 #include "chrome/browser/chrome_notification_types.h" | 16 #include "chrome/browser/chrome_notification_types.h" |
17 #include "chrome/browser/content_settings/cookie_settings.h" | 17 #include "chrome/browser/content_settings/cookie_settings.h" |
18 #include "chrome/browser/content_settings/local_shared_objects_container.h" | 18 #include "chrome/browser/content_settings/local_shared_objects_container.h" |
19 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 19 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
20 #include "chrome/browser/infobars/infobar_service.h" | 20 #include "chrome/browser/infobars/infobar_service.h" |
21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
22 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" | 22 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" |
23 #include "chrome/browser/ui/views/constrained_window_views.h" | |
24 #include "chrome/browser/ui/views/cookie_info_view.h" | 23 #include "chrome/browser/ui/views/cookie_info_view.h" |
25 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
26 #include "components/web_modal/web_contents_modal_dialog_host.h" | 25 #include "components/web_modal/web_contents_modal_dialog_host.h" |
27 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 26 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
28 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" | 27 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
29 #include "content/public/browser/notification_details.h" | 28 #include "content/public/browser/notification_details.h" |
30 #include "content/public/browser/notification_source.h" | 29 #include "content/public/browser/notification_source.h" |
31 #include "content/public/browser/web_contents.h" | 30 #include "content/public/browser/web_contents.h" |
32 #include "grit/generated_resources.h" | 31 #include "grit/generated_resources.h" |
33 #include "grit/locale_settings.h" | 32 #include "grit/locale_settings.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 239 |
241 bool CollectedCookiesViews::Cancel() { | 240 bool CollectedCookiesViews::Cancel() { |
242 if (status_changed_) { | 241 if (status_changed_) { |
243 CollectedCookiesInfoBarDelegate::Create( | 242 CollectedCookiesInfoBarDelegate::Create( |
244 InfoBarService::FromWebContents(web_contents_)); | 243 InfoBarService::FromWebContents(web_contents_)); |
245 } | 244 } |
246 | 245 |
247 return true; | 246 return true; |
248 } | 247 } |
249 | 248 |
250 // TODO(wittman): Remove this override once we move to the new style frame view | |
251 // on all dialogs. | |
252 views::NonClientFrameView* CollectedCookiesViews::CreateNonClientFrameView( | |
253 views::Widget* widget) { | |
254 return CreateConstrainedStyleNonClientFrameView( | |
255 widget, | |
256 web_contents_->GetBrowserContext()); | |
257 } | |
258 | |
259 ui::ModalType CollectedCookiesViews::GetModalType() const { | 249 ui::ModalType CollectedCookiesViews::GetModalType() const { |
260 #if defined(USE_ASH) | 250 #if defined(USE_ASH) |
261 return ui::MODAL_TYPE_CHILD; | 251 return ui::MODAL_TYPE_CHILD; |
262 #else | 252 #else |
263 return views::WidgetDelegate::GetModalType(); | 253 return views::WidgetDelegate::GetModalType(); |
264 #endif | 254 #endif |
265 } | 255 } |
266 | 256 |
267 /////////////////////////////////////////////////////////////////////////////// | 257 /////////////////////////////////////////////////////////////////////////////// |
268 // CollectedCookiesViews, views::ButtonListener implementation: | 258 // CollectedCookiesViews, views::ButtonListener implementation: |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 /////////////////////////////////////////////////////////////////////////////// | 561 /////////////////////////////////////////////////////////////////////////////// |
572 // CollectedCookiesViews, content::NotificationObserver implementation: | 562 // CollectedCookiesViews, content::NotificationObserver implementation: |
573 | 563 |
574 void CollectedCookiesViews::Observe( | 564 void CollectedCookiesViews::Observe( |
575 int type, | 565 int type, |
576 const content::NotificationSource& source, | 566 const content::NotificationSource& source, |
577 const content::NotificationDetails& details) { | 567 const content::NotificationDetails& details) { |
578 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); | 568 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); |
579 window_->Close(); | 569 window_->Close(); |
580 } | 570 } |
OLD | NEW |