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..1de1018caf1791ebda16c00e5397ffae68a2665b 100644 |
--- a/chrome/browser/ui/views/download/download_item_view.h |
+++ b/chrome/browser/ui/views/download/download_item_view.h |
@@ -136,6 +136,13 @@ class DownloadItemView : public views::InkDropHostView, |
void OnBlur() override; |
private: |
+ FRIEND_TEST_ALL_PREFIXES(DownloadItemViewDangerousDownloadLabelTest, |
+ AdjustTextAndGetSize_VeryShortText); |
+ FRIEND_TEST_ALL_PREFIXES(DownloadItemViewDangerousDownloadLabelTest, |
+ AdjustTextAndGetSize_MoreTextOnFirstLine); |
+ FRIEND_TEST_ALL_PREFIXES(DownloadItemViewDangerousDownloadLabelTest, |
+ AdjustTextAndGetSize_VeryLongTextWithoutSpace); |
Peter Kasting
2016/12/08 21:53:52
Nit: No strong feeling here, but if you had a sing
Jialiu Lin
2016/12/08 22:44:03
merged into a single test case.
|
+ |
enum State { NORMAL = 0, HOT, PUSHED }; |
class DropDownButton; |
@@ -197,7 +204,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 +221,10 @@ class DownloadItemView : public views::InkDropHostView, |
// and simply returned on subsequent calls. |
void SizeLabelToMinWidth(); |
+ // Called by SizeLabelToMinWidth() to compute the optimal size (a.k.a minimum |
+ // width) of a label and set its text accordingly. |
Peter Kasting
2016/12/08 21:53:52
Nit: Maybe more detail would help, especially for
Jialiu Lin
2016/12/08 22:44:03
Done.
|
+ 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(); |