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/content_setting_bubble_contents.h" | 5 #include "chrome/browser/ui/views/content_setting_bubble_contents.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 } | 111 } |
112 | 112 |
113 | 113 |
114 // ContentSettingBubbleContents::MediaMenuParts ------------------------------- | 114 // ContentSettingBubbleContents::MediaMenuParts ------------------------------- |
115 | 115 |
116 struct ContentSettingBubbleContents::MediaMenuParts { | 116 struct ContentSettingBubbleContents::MediaMenuParts { |
117 explicit MediaMenuParts(content::MediaStreamType type); | 117 explicit MediaMenuParts(content::MediaStreamType type); |
118 ~MediaMenuParts(); | 118 ~MediaMenuParts(); |
119 | 119 |
120 content::MediaStreamType type; | 120 content::MediaStreamType type; |
121 scoped_ptr<ui::SimpleMenuModel> menu_model; | 121 std::unique_ptr<ui::SimpleMenuModel> menu_model; |
122 | 122 |
123 private: | 123 private: |
124 DISALLOW_COPY_AND_ASSIGN(MediaMenuParts); | 124 DISALLOW_COPY_AND_ASSIGN(MediaMenuParts); |
125 }; | 125 }; |
126 | 126 |
127 ContentSettingBubbleContents::MediaMenuParts::MediaMenuParts( | 127 ContentSettingBubbleContents::MediaMenuParts::MediaMenuParts( |
128 content::MediaStreamType type) | 128 content::MediaStreamType type) |
129 : type(type) {} | 129 : type(type) {} |
130 | 130 |
131 ContentSettingBubbleContents::MediaMenuParts::~MediaMenuParts() {} | 131 ContentSettingBubbleContents::MediaMenuParts::~MediaMenuParts() {} |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 // Make sure the width is at least kMinMediaMenuButtonWidth. The | 488 // Make sure the width is at least kMinMediaMenuButtonWidth. The |
489 // maximum width will be clamped by kMaxContentsWidth of the view. | 489 // maximum width will be clamped by kMaxContentsWidth of the view. |
490 menu_width = std::max(kMinMediaMenuButtonWidth, menu_width + margins); | 490 menu_width = std::max(kMinMediaMenuButtonWidth, menu_width + margins); |
491 | 491 |
492 for (MediaMenuPartsMap::const_iterator i = media_menus_.begin(); | 492 for (MediaMenuPartsMap::const_iterator i = media_menus_.begin(); |
493 i != media_menus_.end(); ++i) { | 493 i != media_menus_.end(); ++i) { |
494 i->first->SetMinSize(gfx::Size(menu_width, 0)); | 494 i->first->SetMinSize(gfx::Size(menu_width, 0)); |
495 i->first->SetMaxSize(gfx::Size(menu_width, 0)); | 495 i->first->SetMaxSize(gfx::Size(menu_width, 0)); |
496 } | 496 } |
497 } | 497 } |
OLD | NEW |