| OLD | NEW |
| 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 <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 namespace ui { | 28 namespace ui { |
| 29 class SimpleMenuModel; | 29 class SimpleMenuModel; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace views { | 32 namespace views { |
| 33 class LabelButton; | 33 class LabelButton; |
| 34 class MenuButton; | 34 class MenuButton; |
| 35 class MenuRunner; | 35 class MenuRunner; |
| 36 class RadioButton; | 36 class RadioButton; |
| 37 class Widget; |
| 37 } | 38 } |
| 38 | 39 |
| 39 // ContentSettingBubbleContents is used when the user turns on different kinds | 40 // ContentSettingBubbleContents is used when the user turns on different kinds |
| 40 // of content blocking (e.g. "block images"). When viewing a page with blocked | 41 // of content blocking (e.g. "block images"). When viewing a page with blocked |
| 41 // content, icons appear in the omnibox corresponding to the content types that | 42 // content, icons appear in the omnibox corresponding to the content types that |
| 42 // were blocked, and the user can click one to get a bubble hosting a few | 43 // were blocked, and the user can click one to get a bubble hosting a few |
| 43 // controls. This class provides the content of that bubble. In general, | 44 // controls. This class provides the content of that bubble. In general, |
| 44 // these bubbles typically have a title, a pair of radio buttons for toggling | 45 // these bubbles typically have a title, a pair of radio buttons for toggling |
| 45 // the blocking settings for the current site, a close button, and a link to | 46 // the blocking settings for the current site, a close button, and a link to |
| 46 // get to a more comprehensive settings management dialog. A few types have | 47 // get to a more comprehensive settings management dialog. A few types have |
| (...skipping 10 matching lines...) Expand all Loading... |
| 57 views::View* anchor_view, | 58 views::View* anchor_view, |
| 58 views::BubbleBorder::Arrow arrow); | 59 views::BubbleBorder::Arrow arrow); |
| 59 ~ContentSettingBubbleContents() override; | 60 ~ContentSettingBubbleContents() override; |
| 60 | 61 |
| 61 gfx::Size GetPreferredSize() const override; | 62 gfx::Size GetPreferredSize() const override; |
| 62 | 63 |
| 63 // Callback to allow ContentSettingMediaMenuModel to update the menu label. | 64 // Callback to allow ContentSettingMediaMenuModel to update the menu label. |
| 64 void UpdateMenuLabel(content::MediaStreamType type, | 65 void UpdateMenuLabel(content::MediaStreamType type, |
| 65 const std::string& label); | 66 const std::string& label); |
| 66 | 67 |
| 68 // Creates and shows the bubble. Returns a bubble widget. With Material Design |
| 69 // the bubble doesn't have an arrow unless |show_arrow| is set. |
| 70 views::Widget* Show(bool show_arrow); |
| 71 |
| 67 protected: | 72 protected: |
| 68 // views::BubbleDelegateView: | 73 // views::BubbleDelegateView: |
| 69 void Init() override; | 74 void Init() override; |
| 70 | 75 |
| 71 private: | 76 private: |
| 72 class Favicon; | 77 class Favicon; |
| 73 struct MediaMenuParts; | 78 struct MediaMenuParts; |
| 74 | 79 |
| 75 // This allows ContentSettingBubbleViewsBridge to call SetAnchorRect(). | 80 // This allows ContentSettingBubbleViewsBridge to call SetAnchorRect(). |
| 76 friend class chrome::ContentSettingBubbleViewsBridge; | 81 friend class chrome::ContentSettingBubbleViewsBridge; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 views::Link* manage_link_; | 114 views::Link* manage_link_; |
| 110 views::Link* learn_more_link_; | 115 views::Link* learn_more_link_; |
| 111 views::LabelButton* close_button_; | 116 views::LabelButton* close_button_; |
| 112 scoped_ptr<views::MenuRunner> menu_runner_; | 117 scoped_ptr<views::MenuRunner> menu_runner_; |
| 113 MediaMenuPartsMap media_menus_; | 118 MediaMenuPartsMap media_menus_; |
| 114 | 119 |
| 115 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingBubbleContents); | 120 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingBubbleContents); |
| 116 }; | 121 }; |
| 117 | 122 |
| 118 #endif // CHROME_BROWSER_UI_VIEWS_CONTENT_SETTING_BUBBLE_CONTENTS_H_ | 123 #endif // CHROME_BROWSER_UI_VIEWS_CONTENT_SETTING_BUBBLE_CONTENTS_H_ |
| OLD | NEW |