Commit e983a4e5 authored by Bret Sepulveda's avatar Bret Sepulveda Committed by Commit Bot

Refactor ContentSettingBubbleContents' layout.

This patch aims to simplify the layout of ContentSettingBubbleContents
by adding a special View for media comboboxes and using BoxLayout for
the main content. Also includes some miscellaneous cleanup.

The visible changes of this patch are:
* The scroll view extends the full width of the dialog.
* The "?" button is the same size as versions in other dialogs.

Bug: 652031
Change-Id: If920a89eee92ff3a0343be0be07cffe1b1b6084c
Reviewed-on: https://chromium-review.googlesource.com/920747Reviewed-by: default avatarAllen Bauer <kylixrd@chromium.org>
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537396}
parent 843d1d5f
......@@ -5,7 +5,6 @@
#ifndef CHROME_BROWSER_UI_VIEWS_CONTENT_SETTING_BUBBLE_CONTENTS_H_
#define CHROME_BROWSER_UI_VIEWS_CONTENT_SETTING_BUBBLE_CONTENTS_H_
#include <list>
#include <map>
#include "base/compiler_specific.h"
......@@ -14,8 +13,6 @@
#include "chrome/browser/ui/content_settings/content_setting_bubble_model.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/media_stream_request.h"
#include "ui/base/models/combobox_model.h"
#include "ui/views/bubble/bubble_dialog_delegate.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/button/checkbox.h"
......@@ -78,27 +75,6 @@ class ContentSettingBubbleContents : public content::WebContentsObserver,
void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
private:
// A combobox model that builds the contents of the media capture devices menu
// in the content setting bubble.
class MediaComboboxModel : public ui::ComboboxModel {
public:
explicit MediaComboboxModel(content::MediaStreamType type);
~MediaComboboxModel() override;
content::MediaStreamType type() const { return type_; }
const content::MediaStreamDevices& GetDevices() const;
int GetDeviceIndex(const content::MediaStreamDevice& device) const;
// ui::ComboboxModel:
int GetItemCount() const override;
base::string16 GetItemAt(int index) override;
private:
content::MediaStreamType type_;
DISALLOW_COPY_AND_ASSIGN(MediaComboboxModel);
};
class Favicon;
class ListItemContainer;
......@@ -135,9 +111,6 @@ class ContentSettingBubbleContents : public content::WebContentsObserver,
views::Checkbox* manage_checkbox_;
views::ImageButton* learn_more_button_;
// Combobox models the bubble owns.
std::list<MediaComboboxModel> combobox_models_;
DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingBubbleContents);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment