| 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/macros.h" | 7 #include "base/macros.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_channel_id_helper.h" | 9 #include "chrome/browser/browsing_data/browsing_data_channel_id_helper.h" |
| 10 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" | 10 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 InfoBarService::FromWebContents(web_contents_)); | 235 InfoBarService::FromWebContents(web_contents_)); |
| 236 } | 236 } |
| 237 return true; | 237 return true; |
| 238 } | 238 } |
| 239 | 239 |
| 240 ui::ModalType CollectedCookiesViews::GetModalType() const { | 240 ui::ModalType CollectedCookiesViews::GetModalType() const { |
| 241 return ui::MODAL_TYPE_CHILD; | 241 return ui::MODAL_TYPE_CHILD; |
| 242 } | 242 } |
| 243 | 243 |
| 244 /////////////////////////////////////////////////////////////////////////////// | 244 /////////////////////////////////////////////////////////////////////////////// |
| 245 // CollectedCookiesViews, views::WidgetDelegate implementation: |
| 246 |
| 247 views::View* CollectedCookiesViews::GetInitiallyFocusedView() { |
| 248 views::View* view = DialogDelegateView::GetInitiallyFocusedView(); |
| 249 return view ? view : allowed_cookies_tree_; |
| 250 } |
| 251 |
| 252 /////////////////////////////////////////////////////////////////////////////// |
| 245 // CollectedCookiesViews, views::ButtonListener implementation: | 253 // CollectedCookiesViews, views::ButtonListener implementation: |
| 246 | 254 |
| 247 void CollectedCookiesViews::ButtonPressed(views::Button* sender, | 255 void CollectedCookiesViews::ButtonPressed(views::Button* sender, |
| 248 const ui::Event& event) { | 256 const ui::Event& event) { |
| 249 if (sender == block_allowed_button_) { | 257 if (sender == block_allowed_button_) { |
| 250 AddContentException(allowed_cookies_tree_, CONTENT_SETTING_BLOCK); | 258 AddContentException(allowed_cookies_tree_, CONTENT_SETTING_BLOCK); |
| 251 } else if (sender == delete_allowed_button_) { | 259 } else if (sender == delete_allowed_button_) { |
| 252 allowed_cookies_tree_model_->DeleteCookieNode( | 260 allowed_cookies_tree_model_->DeleteCookieNode( |
| 253 static_cast<CookieTreeNode*>(allowed_cookies_tree_->GetSelectedNode())); | 261 static_cast<CookieTreeNode*>(allowed_cookies_tree_->GetSelectedNode())); |
| 254 } else if (sender == allow_blocked_button_) { | 262 } else if (sender == allow_blocked_button_) { |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 /////////////////////////////////////////////////////////////////////////////// | 572 /////////////////////////////////////////////////////////////////////////////// |
| 565 // CollectedCookiesViews, content::NotificationObserver implementation: | 573 // CollectedCookiesViews, content::NotificationObserver implementation: |
| 566 | 574 |
| 567 void CollectedCookiesViews::Observe( | 575 void CollectedCookiesViews::Observe( |
| 568 int type, | 576 int type, |
| 569 const content::NotificationSource& source, | 577 const content::NotificationSource& source, |
| 570 const content::NotificationDetails& details) { | 578 const content::NotificationDetails& details) { |
| 571 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); | 579 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); |
| 572 GetWidget()->Close(); | 580 GetWidget()->Close(); |
| 573 } | 581 } |
| OLD | NEW |