OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/download_item_view.h" | 5 #include "chrome/browser/views/download_item_view.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
11 #include "app/text_elider.h" | 11 #include "app/text_elider.h" |
12 #include "app/theme_provider.h" | |
13 #include "base/callback.h" | 12 #include "base/callback.h" |
14 #include "base/file_path.h" | 13 #include "base/file_path.h" |
15 #include "base/histogram.h" | 14 #include "base/histogram.h" |
16 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
17 #include "base/string_util.h" | 16 #include "base/string_util.h" |
18 #include "base/sys_string_conversions.h" | 17 #include "base/sys_string_conversions.h" |
19 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
20 #include "chrome/browser/browser_theme_provider.h" | 19 #include "chrome/browser/browser_theme_provider.h" |
21 #include "chrome/browser/download/download_item_model.h" | 20 #include "chrome/browser/download/download_item_model.h" |
22 #include "chrome/browser/download/download_util.h" | 21 #include "chrome/browser/download/download_util.h" |
23 #include "chrome/browser/views/download_shelf_view.h" | 22 #include "chrome/browser/views/download_shelf_view.h" |
24 #include "gfx/canvas_skia.h" | 23 #include "gfx/canvas_skia.h" |
25 #include "gfx/color_utils.h" | 24 #include "gfx/color_utils.h" |
26 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
27 #include "grit/theme_resources.h" | 26 #include "grit/theme_resources.h" |
28 #include "views/controls/button/native_button.h" | 27 #include "views/controls/button/native_button.h" |
29 #include "views/controls/menu/menu_2.h" | 28 #include "views/controls/menu/menu_2.h" |
30 #include "views/widget/root_view.h" | 29 #include "views/widget/root_view.h" |
31 #include "views/widget/widget.h" | 30 #include "views/widget/widget.h" |
32 | 31 |
33 #if defined(OS_WIN) | |
34 #include "app/win_util.h" | |
35 #endif | |
36 | |
37 using base::TimeDelta; | 32 using base::TimeDelta; |
38 | 33 |
39 // TODO(paulg): These may need to be adjusted when download progress | 34 // TODO(paulg): These may need to be adjusted when download progress |
40 // animation is added, and also possibly to take into account | 35 // animation is added, and also possibly to take into account |
41 // different screen resolutions. | 36 // different screen resolutions. |
42 static const int kTextWidth = 140; // Pixels | 37 static const int kTextWidth = 140; // Pixels |
43 static const int kDangerousTextWidth = 200; // Pixels | 38 static const int kDangerousTextWidth = 200; // Pixels |
44 static const int kHorizontalTextPadding = 2; // Pixels | 39 static const int kHorizontalTextPadding = 2; // Pixels |
45 static const int kVerticalPadding = 3; // Pixels | 40 static const int kVerticalPadding = 3; // Pixels |
46 static const int kVerticalTextSpacer = 2; // Pixels | 41 static const int kVerticalTextSpacer = 2; // Pixels |
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 void DownloadItemView::Reenable() { | 998 void DownloadItemView::Reenable() { |
1004 disabled_while_opening_ = false; | 999 disabled_while_opening_ = false; |
1005 SetEnabled(true); // Triggers a repaint. | 1000 SetEnabled(true); // Triggers a repaint. |
1006 } | 1001 } |
1007 | 1002 |
1008 bool DownloadItemView::InDropDownButtonXCoordinateRange(int x) { | 1003 bool DownloadItemView::InDropDownButtonXCoordinateRange(int x) { |
1009 if (x > drop_down_x_left_ && x < drop_down_x_right_) | 1004 if (x > drop_down_x_left_ && x < drop_down_x_right_) |
1010 return true; | 1005 return true; |
1011 return false; | 1006 return false; |
1012 } | 1007 } |
OLD | NEW |