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

Unified Diff: ash/common/system/chromeos/screen_security/screen_tray_item.cc

Issue 2635103003: [ash-md] Fixed Label::GetTextSize() to account for insets. (Closed)
Patch Set: Added SizeToFit() example use. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/controls/label.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/screen_security/screen_tray_item.cc
diff --git a/ash/common/system/chromeos/screen_security/screen_tray_item.cc b/ash/common/system/chromeos/screen_security/screen_tray_item.cc
index 55b20a1708e5aa55850b2174d671bf32e644f3f2..a07bbd44dd04cbd82eb3569423b742f400f4ac2c 100644
--- a/ash/common/system/chromeos/screen_security/screen_tray_item.cc
+++ b/ash/common/system/chromeos/screen_security/screen_tray_item.cc
@@ -19,6 +19,8 @@
#include "ui/views/controls/label.h"
#include "ui/views/layout/fill_layout.h"
+#include "base/strings/utf_string_conversions.h"
+
namespace ash {
namespace tray {
@@ -41,6 +43,7 @@ ScreenTrayView::~ScreenTrayView() {}
void ScreenTrayView::Update() {
SetVisible(screen_tray_item_->is_started());
+ SetVisible(true);
}
// ScreenStatusView implementations.
@@ -53,6 +56,11 @@ ScreenStatusView::ScreenStatusView(ScreenTrayItem* screen_tray_item,
stop_button_(nullptr),
label_text_(label_text),
stop_button_text_(stop_button_text) {
+ label_text_ = base::ASCIIToUTF16(
+ "Google Hangouts is sharing a window with hangouts.google.com. Google "
+ "Hangouts is sharing a window with hangouts.google.com. Google Hangouts "
+ "is sharing a window with hangouts.google.com. Google Hangouts is "
+ "sharing a window with hangouts.google.com.");
CreateItems();
TriView* tri_view(TrayPopupUtils::CreateDefaultRowView());
SetLayoutManager(new views::FillLayout);
@@ -65,6 +73,7 @@ ScreenStatusView::ScreenStatusView(ScreenTrayItem* screen_tray_item,
views::CreateEmptyBorder(0, 0, 0, kTrayPopupButtonEndMargin));
if (screen_tray_item_)
UpdateFromScreenTrayItem();
+ label_->SizeToFit(225);
}
ScreenStatusView::~ScreenStatusView() {}
@@ -100,6 +109,7 @@ void ScreenStatusView::UpdateFromScreenTrayItem() {
// Hide the notification bubble when the ash tray bubble opens.
screen_tray_item_->HideNotificationView();
SetVisible(screen_tray_item_->is_started());
+ SetVisible(true);
}
void ScreenStatusView::OnNativeThemeChanged(const ui::NativeTheme* theme) {
« no previous file with comments | « no previous file | ui/views/controls/label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698