| 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/views/download/download_item_view.h" | 5 #include "chrome/browser/ui/views/download/download_item_view.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "chrome/browser/ui/views/download/download_feedback_dialog_view.h" | 36 #include "chrome/browser/ui/views/download/download_feedback_dialog_view.h" |
| 37 #include "chrome/browser/ui/views/download/download_shelf_context_menu_view.h" | 37 #include "chrome/browser/ui/views/download/download_shelf_context_menu_view.h" |
| 38 #include "chrome/browser/ui/views/download/download_shelf_view.h" | 38 #include "chrome/browser/ui/views/download/download_shelf_view.h" |
| 39 #include "chrome/browser/ui/views/frame/browser_view.h" | 39 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 40 #include "chrome/common/pref_names.h" | 40 #include "chrome/common/pref_names.h" |
| 41 #include "chrome/grit/generated_resources.h" | 41 #include "chrome/grit/generated_resources.h" |
| 42 #include "components/prefs/pref_service.h" | 42 #include "components/prefs/pref_service.h" |
| 43 #include "components/safe_browsing_db/safe_browsing_prefs.h" | 43 #include "components/safe_browsing_db/safe_browsing_prefs.h" |
| 44 #include "content/public/browser/download_danger_type.h" | 44 #include "content/public/browser/download_danger_type.h" |
| 45 #include "third_party/icu/source/common/unicode/uchar.h" | 45 #include "third_party/icu/source/common/unicode/uchar.h" |
| 46 #include "ui/accessibility/ax_view_state.h" | 46 #include "ui/accessibility/ax_node_data.h" |
| 47 #include "ui/base/l10n/l10n_util.h" | 47 #include "ui/base/l10n/l10n_util.h" |
| 48 #include "ui/base/resource/resource_bundle.h" | 48 #include "ui/base/resource/resource_bundle.h" |
| 49 #include "ui/base/theme_provider.h" | 49 #include "ui/base/theme_provider.h" |
| 50 #include "ui/events/event.h" | 50 #include "ui/events/event.h" |
| 51 #include "ui/gfx/animation/slide_animation.h" | 51 #include "ui/gfx/animation/slide_animation.h" |
| 52 #include "ui/gfx/canvas.h" | 52 #include "ui/gfx/canvas.h" |
| 53 #include "ui/gfx/color_palette.h" | 53 #include "ui/gfx/color_palette.h" |
| 54 #include "ui/gfx/color_utils.h" | 54 #include "ui/gfx/color_utils.h" |
| 55 #include "ui/gfx/image/image.h" | 55 #include "ui/gfx/image/image.h" |
| 56 #include "ui/gfx/paint_vector_icon.h" | 56 #include "ui/gfx/paint_vector_icon.h" |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 if (IsShowingWarningDialog()) { | 463 if (IsShowingWarningDialog()) { |
| 464 tooltip->clear(); | 464 tooltip->clear(); |
| 465 return false; | 465 return false; |
| 466 } | 466 } |
| 467 | 467 |
| 468 tooltip->assign(tooltip_text_); | 468 tooltip->assign(tooltip_text_); |
| 469 | 469 |
| 470 return true; | 470 return true; |
| 471 } | 471 } |
| 472 | 472 |
| 473 void DownloadItemView::GetAccessibleState(ui::AXViewState* state) { | 473 void DownloadItemView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 474 state->name = accessible_name_; | 474 node_data->SetName(accessible_name_); |
| 475 state->role = ui::AX_ROLE_BUTTON; | 475 node_data->role = ui::AX_ROLE_BUTTON; |
| 476 if (model_.IsDangerous()) | 476 if (model_.IsDangerous()) |
| 477 state->AddStateFlag(ui::AX_STATE_DISABLED); | 477 node_data->AddStateFlag(ui::AX_STATE_DISABLED); |
| 478 else | 478 else |
| 479 state->AddStateFlag(ui::AX_STATE_HASPOPUP); | 479 node_data->AddStateFlag(ui::AX_STATE_HASPOPUP); |
| 480 } | 480 } |
| 481 | 481 |
| 482 void DownloadItemView::OnThemeChanged() { | 482 void DownloadItemView::OnThemeChanged() { |
| 483 UpdateColorsFromTheme(); | 483 UpdateColorsFromTheme(); |
| 484 SchedulePaint(); | 484 SchedulePaint(); |
| 485 } | 485 } |
| 486 | 486 |
| 487 void DownloadItemView::AddInkDropLayer(ui::Layer* ink_drop_layer) { | 487 void DownloadItemView::AddInkDropLayer(ui::Layer* ink_drop_layer) { |
| 488 InkDropHostView::AddInkDropLayer(ink_drop_layer); | 488 InkDropHostView::AddInkDropLayer(ink_drop_layer); |
| 489 // The layer that's added to host the ink drop layer must mask to bounds | 489 // The layer that's added to host the ink drop layer must mask to bounds |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1104 SchedulePaint(); | 1104 SchedulePaint(); |
| 1105 } | 1105 } |
| 1106 | 1106 |
| 1107 SkColor DownloadItemView::GetTextColor() const { | 1107 SkColor DownloadItemView::GetTextColor() const { |
| 1108 return GetTextColorForThemeProvider(GetThemeProvider()); | 1108 return GetTextColorForThemeProvider(GetThemeProvider()); |
| 1109 } | 1109 } |
| 1110 | 1110 |
| 1111 SkColor DownloadItemView::GetDimmedTextColor() const { | 1111 SkColor DownloadItemView::GetDimmedTextColor() const { |
| 1112 return SkColorSetA(GetTextColor(), 0xC7); | 1112 return SkColorSetA(GetTextColor(), 0xC7); |
| 1113 } | 1113 } |
| OLD | NEW |