| 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 19 matching lines...) Expand all Loading... |
| 30 #include "content/public/browser/notification_details.h" | 30 #include "content/public/browser/notification_details.h" |
| 31 #include "content/public/browser/notification_source.h" | 31 #include "content/public/browser/notification_source.h" |
| 32 #include "content/public/browser/web_contents.h" | 32 #include "content/public/browser/web_contents.h" |
| 33 #include "grit/components_strings.h" | 33 #include "grit/components_strings.h" |
| 34 #include "grit/theme_resources.h" | 34 #include "grit/theme_resources.h" |
| 35 #include "net/cookies/canonical_cookie.h" | 35 #include "net/cookies/canonical_cookie.h" |
| 36 #include "ui/base/l10n/l10n_util.h" | 36 #include "ui/base/l10n/l10n_util.h" |
| 37 #include "ui/base/resource/resource_bundle.h" | 37 #include "ui/base/resource/resource_bundle.h" |
| 38 #include "ui/gfx/color_utils.h" | 38 #include "ui/gfx/color_utils.h" |
| 39 #include "ui/views/border.h" | 39 #include "ui/views/border.h" |
| 40 #include "ui/views/controls/button/label_button.h" | 40 #include "ui/views/controls/button/md_text_button.h" |
| 41 #include "ui/views/controls/image_view.h" | 41 #include "ui/views/controls/image_view.h" |
| 42 #include "ui/views/controls/label.h" | 42 #include "ui/views/controls/label.h" |
| 43 #include "ui/views/controls/scroll_view.h" | 43 #include "ui/views/controls/scroll_view.h" |
| 44 #include "ui/views/controls/tabbed_pane/tabbed_pane.h" | 44 #include "ui/views/controls/tabbed_pane/tabbed_pane.h" |
| 45 #include "ui/views/controls/tree/tree_view.h" | 45 #include "ui/views/controls/tree/tree_view.h" |
| 46 #include "ui/views/layout/box_layout.h" | 46 #include "ui/views/layout/box_layout.h" |
| 47 #include "ui/views/layout/grid_layout.h" | 47 #include "ui/views/layout/grid_layout.h" |
| 48 #include "ui/views/layout/layout_constants.h" | 48 #include "ui/views/layout/layout_constants.h" |
| 49 #include "ui/views/widget/widget.h" | 49 #include "ui/views/widget/widget.h" |
| 50 | 50 |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 335 |
| 336 allowed_cookies_tree_model_ = | 336 allowed_cookies_tree_model_ = |
| 337 content_settings->CreateAllowedCookiesTreeModel(); | 337 content_settings->CreateAllowedCookiesTreeModel(); |
| 338 allowed_cookies_tree_ = new views::TreeView(); | 338 allowed_cookies_tree_ = new views::TreeView(); |
| 339 allowed_cookies_tree_->SetModel(allowed_cookies_tree_model_.get()); | 339 allowed_cookies_tree_->SetModel(allowed_cookies_tree_model_.get()); |
| 340 allowed_cookies_tree_->SetRootShown(false); | 340 allowed_cookies_tree_->SetRootShown(false); |
| 341 allowed_cookies_tree_->SetEditable(false); | 341 allowed_cookies_tree_->SetEditable(false); |
| 342 allowed_cookies_tree_->set_auto_expand_children(true); | 342 allowed_cookies_tree_->set_auto_expand_children(true); |
| 343 allowed_cookies_tree_->SetController(this); | 343 allowed_cookies_tree_->SetController(this); |
| 344 | 344 |
| 345 block_allowed_button_ = new views::LabelButton(this, | 345 block_allowed_button_ = views::MdTextButton::CreateSecondaryUiButton(this, |
| 346 l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_BLOCK_BUTTON)); | 346 l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_BLOCK_BUTTON)); |
| 347 block_allowed_button_->SetStyle(views::Button::STYLE_BUTTON); | |
| 348 | 347 |
| 349 delete_allowed_button_ = new views::LabelButton(this, | 348 delete_allowed_button_ = views::MdTextButton::CreateSecondaryUiButton(this, |
| 350 l10n_util::GetStringUTF16(IDS_COOKIES_REMOVE_LABEL)); | 349 l10n_util::GetStringUTF16(IDS_COOKIES_REMOVE_LABEL)); |
| 351 delete_allowed_button_->SetStyle(views::Button::STYLE_BUTTON); | |
| 352 | 350 |
| 353 // Create the view that holds all the controls together. This will be the | 351 // Create the view that holds all the controls together. This will be the |
| 354 // pane added to the tabbed pane. | 352 // pane added to the tabbed pane. |
| 355 using views::GridLayout; | 353 using views::GridLayout; |
| 356 | 354 |
| 357 views::View* pane = new views::View(); | 355 views::View* pane = new views::View(); |
| 358 GridLayout* layout = GridLayout::CreatePanel(pane); | 356 GridLayout* layout = GridLayout::CreatePanel(pane); |
| 359 layout->SetInsets(kVPanelPadding, views::kButtonHEdgeMarginNew, | 357 layout->SetInsets(kVPanelPadding, views::kButtonHEdgeMarginNew, |
| 360 kVPanelPadding, views::kButtonHEdgeMarginNew); | 358 kVPanelPadding, views::kButtonHEdgeMarginNew); |
| 361 pane->SetLayoutManager(layout); | 359 pane->SetLayoutManager(layout); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 blocked_label_->SizeToFit(kTreeViewWidth); | 407 blocked_label_->SizeToFit(kTreeViewWidth); |
| 410 blocked_cookies_tree_model_ = | 408 blocked_cookies_tree_model_ = |
| 411 content_settings->CreateBlockedCookiesTreeModel(); | 409 content_settings->CreateBlockedCookiesTreeModel(); |
| 412 blocked_cookies_tree_ = new views::TreeView(); | 410 blocked_cookies_tree_ = new views::TreeView(); |
| 413 blocked_cookies_tree_->SetModel(blocked_cookies_tree_model_.get()); | 411 blocked_cookies_tree_->SetModel(blocked_cookies_tree_model_.get()); |
| 414 blocked_cookies_tree_->SetRootShown(false); | 412 blocked_cookies_tree_->SetRootShown(false); |
| 415 blocked_cookies_tree_->SetEditable(false); | 413 blocked_cookies_tree_->SetEditable(false); |
| 416 blocked_cookies_tree_->set_auto_expand_children(true); | 414 blocked_cookies_tree_->set_auto_expand_children(true); |
| 417 blocked_cookies_tree_->SetController(this); | 415 blocked_cookies_tree_->SetController(this); |
| 418 | 416 |
| 419 allow_blocked_button_ = new views::LabelButton(this, | 417 allow_blocked_button_ = views::MdTextButton::CreateSecondaryUiButton( |
| 420 l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_ALLOW_BUTTON)); | 418 this, l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_ALLOW_BUTTON)); |
| 421 allow_blocked_button_->SetStyle(views::Button::STYLE_BUTTON); | 419 for_session_blocked_button_ = views::MdTextButton::CreateSecondaryUiButton( |
| 422 for_session_blocked_button_ = new views::LabelButton(this, | 420 this, |
| 423 l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_SESSION_ONLY_BUTTON)); | 421 l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_SESSION_ONLY_BUTTON)); |
| 424 for_session_blocked_button_->SetStyle(views::Button::STYLE_BUTTON); | |
| 425 | 422 |
| 426 // Create the view that holds all the controls together. This will be the | 423 // Create the view that holds all the controls together. This will be the |
| 427 // pane added to the tabbed pane. | 424 // pane added to the tabbed pane. |
| 428 using views::GridLayout; | 425 using views::GridLayout; |
| 429 | 426 |
| 430 views::View* pane = new views::View(); | 427 views::View* pane = new views::View(); |
| 431 GridLayout* layout = GridLayout::CreatePanel(pane); | 428 GridLayout* layout = GridLayout::CreatePanel(pane); |
| 432 layout->SetInsets(kVPanelPadding, views::kButtonHEdgeMarginNew, | 429 layout->SetInsets(kVPanelPadding, views::kButtonHEdgeMarginNew, |
| 433 kVPanelPadding, views::kButtonHEdgeMarginNew); | 430 kVPanelPadding, views::kButtonHEdgeMarginNew); |
| 434 pane->SetLayoutManager(layout); | 431 pane->SetLayoutManager(layout); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 /////////////////////////////////////////////////////////////////////////////// | 532 /////////////////////////////////////////////////////////////////////////////// |
| 536 // CollectedCookiesViews, content::NotificationObserver implementation: | 533 // CollectedCookiesViews, content::NotificationObserver implementation: |
| 537 | 534 |
| 538 void CollectedCookiesViews::Observe( | 535 void CollectedCookiesViews::Observe( |
| 539 int type, | 536 int type, |
| 540 const content::NotificationSource& source, | 537 const content::NotificationSource& source, |
| 541 const content::NotificationDetails& details) { | 538 const content::NotificationDetails& details) { |
| 542 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); | 539 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); |
| 543 GetWidget()->Close(); | 540 GetWidget()->Close(); |
| 544 } | 541 } |
| OLD | NEW |