Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(441)

Side by Side Diff: chrome/browser/ui/views/content_setting_bubble_contents.h

Issue 2169453003: Hide protocol handler icon in location bar after user is done (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_VIEWS_CONTENT_SETTING_BUBBLE_CONTENTS_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_CONTENT_SETTING_BUBBLE_CONTENTS_H_
6 #define CHROME_BROWSER_UI_VIEWS_CONTENT_SETTING_BUBBLE_CONTENTS_H_ 6 #define CHROME_BROWSER_UI_VIEWS_CONTENT_SETTING_BUBBLE_CONTENTS_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "components/content_settings/core/common/content_settings_types.h" 13 #include "components/content_settings/core/common/content_settings_types.h"
14 #include "content/public/browser/web_contents_observer.h" 14 #include "content/public/browser/web_contents_observer.h"
15 #include "content/public/common/media_stream_request.h" 15 #include "content/public/common/media_stream_request.h"
16 #include "ui/base/models/combobox_model.h" 16 #include "ui/base/models/combobox_model.h"
17 #include "ui/views/bubble/bubble_dialog_delegate.h" 17 #include "ui/views/bubble/bubble_dialog_delegate.h"
18 #include "ui/views/controls/button/button.h" 18 #include "ui/views/controls/button/button.h"
19 #include "ui/views/controls/combobox/combobox_listener.h" 19 #include "ui/views/controls/combobox/combobox_listener.h"
20 #include "ui/views/controls/link_listener.h" 20 #include "ui/views/controls/link_listener.h"
21 21
22 class ContentSettingBubbleModel; 22 class ContentSettingBubbleModel;
23 class Profile; 23 class Profile;
24 24
25 namespace chrome { 25 namespace chrome {
26 class ContentSettingBubbleViewsBridge; 26 class ContentSettingBubbleViewsBridge;
27 } 27 }
28 28
29 namespace views { 29 namespace views {
30 class LabelButton; 30 class LabelButton;
msw 2016/07/20 20:50:17 nit: remove
Evan Stade 2016/07/20 22:16:17 Done.
31 class RadioButton; 31 class RadioButton;
32 } 32 }
33 33
34 // ContentSettingBubbleContents is used when the user turns on different kinds 34 // ContentSettingBubbleContents is used when the user turns on different kinds
35 // of content blocking (e.g. "block images"). When viewing a page with blocked 35 // of content blocking (e.g. "block images"). When viewing a page with blocked
36 // content, icons appear in the omnibox corresponding to the content types that 36 // content, icons appear in the omnibox corresponding to the content types that
37 // were blocked, and the user can click one to get a bubble hosting a few 37 // were blocked, and the user can click one to get a bubble hosting a few
38 // controls. This class provides the content of that bubble. In general, 38 // controls. This class provides the content of that bubble. In general,
39 // these bubbles typically have a title, a pair of radio buttons for toggling 39 // these bubbles typically have a title, a pair of radio buttons for toggling
40 // the blocking settings for the current site, a close button, and a link to 40 // the blocking settings for the current site, a close button, and a link to
(...skipping 11 matching lines...) Expand all
52 views::View* anchor_view, 52 views::View* anchor_view,
53 views::BubbleBorder::Arrow arrow); 53 views::BubbleBorder::Arrow arrow);
54 ~ContentSettingBubbleContents() override; 54 ~ContentSettingBubbleContents() override;
55 55
56 gfx::Size GetPreferredSize() const override; 56 gfx::Size GetPreferredSize() const override;
57 57
58 protected: 58 protected:
59 // views::BubbleDialogDelegateView: 59 // views::BubbleDialogDelegateView:
60 void Init() override; 60 void Init() override;
61 View* CreateExtraView() override; 61 View* CreateExtraView() override;
62 bool Accept() override;
63 bool Close() override;
62 int GetDialogButtons() const override; 64 int GetDialogButtons() const override;
63 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; 65 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
64 66
65 private: 67 private:
66 // A combobox model that builds the contents of the media capture devices menu 68 // A combobox model that builds the contents of the media capture devices menu
67 // in the content setting bubble. 69 // in the content setting bubble.
68 class MediaComboboxModel : public ui::ComboboxModel { 70 class MediaComboboxModel : public ui::ComboboxModel {
69 public: 71 public:
70 explicit MediaComboboxModel(content::MediaStreamType type); 72 explicit MediaComboboxModel(content::MediaStreamType type);
71 ~MediaComboboxModel() override; 73 ~MediaComboboxModel() override;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 std::unique_ptr<ContentSettingBubbleModel> content_setting_bubble_model_; 111 std::unique_ptr<ContentSettingBubbleModel> content_setting_bubble_model_;
110 112
111 // Some of our controls, so we can tell what's been clicked when we get a 113 // Some of our controls, so we can tell what's been clicked when we get a
112 // message. 114 // message.
113 ListItemLinks list_item_links_; 115 ListItemLinks list_item_links_;
114 typedef std::vector<views::RadioButton*> RadioGroup; 116 typedef std::vector<views::RadioButton*> RadioGroup;
115 RadioGroup radio_group_; 117 RadioGroup radio_group_;
116 views::Link* custom_link_; 118 views::Link* custom_link_;
117 views::Link* manage_link_; 119 views::Link* manage_link_;
118 views::Link* learn_more_link_; 120 views::Link* learn_more_link_;
119 views::LabelButton* close_button_;
120 121
121 // Combobox models the bubble owns. 122 // Combobox models the bubble owns.
122 std::list<MediaComboboxModel> combobox_models_; 123 std::list<MediaComboboxModel> combobox_models_;
123 124
124 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingBubbleContents); 125 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingBubbleContents);
125 }; 126 };
126 127
127 #endif // CHROME_BROWSER_UI_VIEWS_CONTENT_SETTING_BUBBLE_CONTENTS_H_ 128 #endif // CHROME_BROWSER_UI_VIEWS_CONTENT_SETTING_BUBBLE_CONTENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698