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

Unified Diff: chrome/browser/ui/views/download/download_item_view.h

Issue 2556573002: Fix SizeLabelToMinWidth() function such that no unnecessary space (Closed)
Patch Set: change to ViewsTestBase Created 4 years 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 | chrome/browser/ui/views/download/download_item_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/download/download_item_view.h
diff --git a/chrome/browser/ui/views/download/download_item_view.h b/chrome/browser/ui/views/download/download_item_view.h
index 1b4db80a90d7b12e584ee5b5480cd4e46dad3748..1b28c4f5d94c4a9095fbee6a7deb203b165078ee 100644
--- a/chrome/browser/ui/views/download/download_item_view.h
+++ b/chrome/browser/ui/views/download/download_item_view.h
@@ -136,6 +136,9 @@ class DownloadItemView : public views::InkDropHostView,
void OnBlur() override;
private:
+ FRIEND_TEST_ALL_PREFIXES(DownloadItemViewDangerousDownloadLabelTest,
+ AdjustTextAndGetSize);
+
enum State { NORMAL = 0, HOT, PUSHED };
class DropDownButton;
@@ -197,7 +200,7 @@ class DownloadItemView : public views::InkDropHostView,
// Reverts from dangerous mode to normal download mode.
void ClearWarningDialog();
- // Start displaying the dangerous download warning or the malicious download
+ // Starts displaying the dangerous download warning or the malicious download
// warning.
void ShowWarningDialog();
@@ -214,6 +217,12 @@ class DownloadItemView : public views::InkDropHostView,
// and simply returned on subsequent calls.
void SizeLabelToMinWidth();
+ // Given a multiline |label|, decides whether it should be displayed on one
+ // line (if short), or broken across two lines. In the latter case,
+ // linebreaks near the middle of the string and sets the label's text
+ // accordingly. Returns the preferred size for the label.
+ static gfx::Size AdjustTextAndGetSize(views::Label* label);
+
// Reenables the item after it has been disabled when a user clicked it to
// open the downloaded file.
void Reenable();
« no previous file with comments | « no previous file | chrome/browser/ui/views/download/download_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698