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" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 TabSpecificContentSettings::FromWebContents(web_contents); | 207 TabSpecificContentSettings::FromWebContents(web_contents); |
208 registrar_.Add(this, chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, | 208 registrar_.Add(this, chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, |
209 content::Source<TabSpecificContentSettings>(content_settings)); | 209 content::Source<TabSpecificContentSettings>(content_settings)); |
210 WebContentsModalDialogManager* web_contents_modal_dialog_manager = | 210 WebContentsModalDialogManager* web_contents_modal_dialog_manager = |
211 WebContentsModalDialogManager::FromWebContents(web_contents); | 211 WebContentsModalDialogManager::FromWebContents(web_contents); |
212 WebContentsModalDialogManagerDelegate* modal_delegate = | 212 WebContentsModalDialogManagerDelegate* modal_delegate = |
213 web_contents_modal_dialog_manager->delegate(); | 213 web_contents_modal_dialog_manager->delegate(); |
214 DCHECK(modal_delegate); | 214 DCHECK(modal_delegate); |
215 window_ = views::Widget::CreateWindowAsFramelessChild( | 215 window_ = views::Widget::CreateWindowAsFramelessChild( |
216 this, modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); | 216 this, modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); |
217 web_contents_modal_dialog_manager->ShowDialog(window_->GetNativeView()); | 217 web_contents_modal_dialog_manager->ShowModalDialog( |
| 218 window_->GetNativeView()); |
218 } | 219 } |
219 | 220 |
220 /////////////////////////////////////////////////////////////////////////////// | 221 /////////////////////////////////////////////////////////////////////////////// |
221 // CollectedCookiesViews, views::DialogDelegate implementation: | 222 // CollectedCookiesViews, views::DialogDelegate implementation: |
222 | 223 |
223 base::string16 CollectedCookiesViews::GetWindowTitle() const { | 224 base::string16 CollectedCookiesViews::GetWindowTitle() const { |
224 return l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_DIALOG_TITLE); | 225 return l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_DIALOG_TITLE); |
225 } | 226 } |
226 | 227 |
227 int CollectedCookiesViews::GetDialogButtons() const { | 228 int CollectedCookiesViews::GetDialogButtons() const { |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 /////////////////////////////////////////////////////////////////////////////// | 562 /////////////////////////////////////////////////////////////////////////////// |
562 // CollectedCookiesViews, content::NotificationObserver implementation: | 563 // CollectedCookiesViews, content::NotificationObserver implementation: |
563 | 564 |
564 void CollectedCookiesViews::Observe( | 565 void CollectedCookiesViews::Observe( |
565 int type, | 566 int type, |
566 const content::NotificationSource& source, | 567 const content::NotificationSource& source, |
567 const content::NotificationDetails& details) { | 568 const content::NotificationDetails& details) { |
568 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); | 569 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); |
569 window_->Close(); | 570 window_->Close(); |
570 } | 571 } |
OLD | NEW |