| 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/gtk/content_setting_bubble_gtk.h" | 5 #include "chrome/browser/ui/gtk/content_setting_bubble_gtk.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 // The maximum width of a title entry in the content box. We elide anything | 41 // The maximum width of a title entry in the content box. We elide anything |
| 42 // longer than this. | 42 // longer than this. |
| 43 const int kMaxLinkPixelSize = 500; | 43 const int kMaxLinkPixelSize = 500; |
| 44 | 44 |
| 45 // The minimum and maximum width of the media menu buttons. | 45 // The minimum and maximum width of the media menu buttons. |
| 46 const int kMinMediaMenuButtonWidth = 100; | 46 const int kMinMediaMenuButtonWidth = 100; |
| 47 const int kMaxMediaMenuButtonWidth = 600; | 47 const int kMaxMediaMenuButtonWidth = 600; |
| 48 | 48 |
| 49 std::string BuildElidedText(const std::string& input) { | 49 std::string BuildElidedText(const std::string& input) { |
| 50 return UTF16ToUTF8(gfx::ElideText( | 50 return base::UTF16ToUTF8(gfx::ElideText( |
| 51 UTF8ToUTF16(input), | 51 base::UTF8ToUTF16(input), |
| 52 gfx::Font(), | 52 gfx::Font(), |
| 53 kMaxLinkPixelSize, | 53 kMaxLinkPixelSize, |
| 54 gfx::ELIDE_AT_END)); | 54 gfx::ELIDE_AT_END)); |
| 55 } | 55 } |
| 56 | 56 |
| 57 } // namespace | 57 } // namespace |
| 58 | 58 |
| 59 ContentSettingBubbleGtk::ContentSettingBubbleGtk( | 59 ContentSettingBubbleGtk::ContentSettingBubbleGtk( |
| 60 GtkWidget* anchor, | 60 GtkWidget* anchor, |
| 61 BubbleDelegateGtk* delegate, | 61 BubbleDelegateGtk* delegate, |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 GtkMediaMenuMap::iterator i(media_menus_.find(button)); | 383 GtkMediaMenuMap::iterator i(media_menus_.find(button)); |
| 384 DCHECK(i != media_menus_.end()); | 384 DCHECK(i != media_menus_.end()); |
| 385 i->second->menu->PopupForWidget(button, 1, gtk_get_current_event_time()); | 385 i->second->menu->PopupForWidget(button, 1, gtk_get_current_event_time()); |
| 386 } | 386 } |
| 387 | 387 |
| 388 ContentSettingBubbleGtk::MediaMenuGtk::MediaMenuGtk( | 388 ContentSettingBubbleGtk::MediaMenuGtk::MediaMenuGtk( |
| 389 content::MediaStreamType type) | 389 content::MediaStreamType type) |
| 390 : type(type) {} | 390 : type(type) {} |
| 391 | 391 |
| 392 ContentSettingBubbleGtk::MediaMenuGtk::~MediaMenuGtk() {} | 392 ContentSettingBubbleGtk::MediaMenuGtk::~MediaMenuGtk() {} |
| OLD | NEW |