| Index: chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc
|
| diff --git a/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc b/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc
|
| index 6d8c8c65c85d580fe206030d4bbb53c0648e88db..c74918d201447d2ce86b4df706976ff9ad427756 100644
|
| --- a/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc
|
| +++ b/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc
|
| @@ -9,13 +9,11 @@
|
| #include "grit/theme_resources.h"
|
| #include "third_party/skia/include/core/SkColor.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
| -#include "ui/base/resource/resource_bundle.h"
|
| #include "ui/gfx/geometry/rect.h"
|
| #include "ui/views/border.h"
|
| #include "ui/views/context_menu_controller.h"
|
| #include "ui/views/controls/button/button.h"
|
| #include "ui/views/controls/button/checkbox.h"
|
| -#include "ui/views/controls/button/image_button.h"
|
| #include "ui/views/controls/label.h"
|
| #include "ui/views/layout/box_layout.h"
|
| #include "ui/views/layout/layout_constants.h"
|
| @@ -29,7 +27,6 @@ const SkColor kDeemphasizedTextColor = SkColorSetRGB(159, 159, 159);
|
|
|
| MediaGalleryCheckboxView::MediaGalleryCheckboxView(
|
| const MediaGalleryPrefInfo& pref_info,
|
| - bool show_folder_button,
|
| int trailing_vertical_space,
|
| views::ButtonListener* button_listener,
|
| views::ContextMenuController* menu_controller) {
|
| @@ -50,21 +47,6 @@ MediaGalleryCheckboxView::MediaGalleryCheckboxView(
|
| base::string16 tooltip_text = pref_info.GetGalleryTooltip();
|
| checkbox_->SetTooltipText(tooltip_text);
|
|
|
| - ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
|
| - folder_viewer_button_ = new views::ImageButton(button_listener);
|
| - if (menu_controller)
|
| - folder_viewer_button_->set_context_menu_controller(menu_controller);
|
| - folder_viewer_button_->SetImage(views::ImageButton::STATE_NORMAL,
|
| - rb.GetImageSkiaNamed(IDR_FILE_FOLDER));
|
| - folder_viewer_button_->SetImageAlignment(views::ImageButton::ALIGN_CENTER,
|
| - views::ImageButton::ALIGN_MIDDLE);
|
| - folder_viewer_button_->SetAccessibleName(l10n_util::GetStringUTF16(
|
| - IDS_MEDIA_GALLERIES_SCAN_RESULT_OPEN_FOLDER_VIEW_ACCESSIBILITY_NAME));
|
| - folder_viewer_button_->SetFocusable(true);
|
| - folder_viewer_button_->SetVisible(show_folder_button);
|
| - folder_viewer_button_->SetBorder(views::Border::CreateEmptyBorder(
|
| - 0, views::kRelatedControlSmallHorizontalSpacing, 0, 0));
|
| -
|
| base::string16 details = pref_info.GetGalleryAdditionalDetails();
|
| secondary_text_ = new views::Label(details);
|
| if (menu_controller)
|
| @@ -77,7 +59,6 @@ MediaGalleryCheckboxView::MediaGalleryCheckboxView(
|
| 0, views::kRelatedControlSmallHorizontalSpacing, 0, 0));
|
|
|
| AddChildView(checkbox_);
|
| - AddChildView(folder_viewer_button_);
|
| AddChildView(secondary_text_);
|
| }
|
|
|
| @@ -88,35 +69,25 @@ void MediaGalleryCheckboxView::Layout() {
|
| if (GetPreferredSize().width() <= GetLocalBounds().width())
|
| return;
|
|
|
| - // If box layout doesn't fit, do custom layout. The folder_viewer_button and
|
| - // the secondary text should take up at most half of the space and the
|
| - // checkbox can take up what ever is left.
|
| + // If box layout doesn't fit, do custom layout. The secondary text should take
|
| + // up at most half of the space and the checkbox can take up whatever is left.
|
| int checkbox_width = checkbox_->GetPreferredSize().width();
|
| - int folder_viewer_width = folder_viewer_button_->GetPreferredSize().width();
|
| int secondary_text_width = secondary_text_->GetPreferredSize().width();
|
| - if (!folder_viewer_button_->visible())
|
| - folder_viewer_width = 0;
|
| if (!secondary_text_->visible())
|
| secondary_text_width = 0;
|
|
|
| gfx::Rect area(GetLocalBounds());
|
| area.Inset(GetInsets());
|
|
|
| - if (folder_viewer_width + secondary_text_width > area.width() / 2) {
|
| + if (secondary_text_width > area.width() / 2) {
|
| secondary_text_width =
|
| - std::max(area.width() / 2 - folder_viewer_width,
|
| - area.width() - folder_viewer_width - checkbox_width);
|
| + std::max(area.width() / 2, area.width() - checkbox_width);
|
| }
|
| - checkbox_width = area.width() - folder_viewer_width - secondary_text_width;
|
| + checkbox_width = area.width() - secondary_text_width;
|
|
|
| checkbox_->SetBounds(area.x(), area.y(), checkbox_width, area.height());
|
| - if (folder_viewer_button_->visible()) {
|
| - folder_viewer_button_->SetBounds(checkbox_->x() + checkbox_width, area.y(),
|
| - folder_viewer_width, area.height());
|
| - }
|
| if (secondary_text_->visible()) {
|
| - secondary_text_->SetBounds(
|
| - checkbox_->x() + checkbox_width + folder_viewer_width,
|
| - area.y(), secondary_text_width, area.height());
|
| + secondary_text_->SetBounds(checkbox_->x() + checkbox_width, area.y(),
|
| + secondary_text_width, area.height());
|
| }
|
| }
|
|
|