| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 | 490 |
| 491 tooltip->assign(tooltip_text_); | 491 tooltip->assign(tooltip_text_); |
| 492 | 492 |
| 493 return true; | 493 return true; |
| 494 } | 494 } |
| 495 | 495 |
| 496 void DownloadItemView::GetAccessibleState(ui::AXViewState* state) { | 496 void DownloadItemView::GetAccessibleState(ui::AXViewState* state) { |
| 497 state->name = accessible_name_; | 497 state->name = accessible_name_; |
| 498 state->role = ui::AX_ROLE_BUTTON; | 498 state->role = ui::AX_ROLE_BUTTON; |
| 499 if (model_.IsDangerous()) { | 499 if (model_.IsDangerous()) { |
| 500 state->state = ui::AX_STATE_DISABLED; | 500 state->SetStateFlag(ui::AX_STATE_DISABLED); |
| 501 } else { | 501 } else { |
| 502 state->state = ui::AX_STATE_HASPOPUP; | 502 state->SetStateFlag(ui::AX_STATE_HASPOPUP); |
| 503 } | 503 } |
| 504 } | 504 } |
| 505 | 505 |
| 506 void DownloadItemView::OnThemeChanged() { | 506 void DownloadItemView::OnThemeChanged() { |
| 507 UpdateColorsFromTheme(); | 507 UpdateColorsFromTheme(); |
| 508 } | 508 } |
| 509 | 509 |
| 510 void DownloadItemView::OnGestureEvent(ui::GestureEvent* event) { | 510 void DownloadItemView::OnGestureEvent(ui::GestureEvent* event) { |
| 511 if (event->type() == ui::ET_GESTURE_TAP_DOWN) { | 511 if (event->type() == ui::ET_GESTURE_TAP_DOWN) { |
| 512 HandlePressEvent(*event, true); | 512 HandlePressEvent(*event, true); |
| (...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1346 void DownloadItemView::AnimateStateTransition(State from, State to, | 1346 void DownloadItemView::AnimateStateTransition(State from, State to, |
| 1347 gfx::SlideAnimation* animation) { | 1347 gfx::SlideAnimation* animation) { |
| 1348 if (from == NORMAL && to == HOT) { | 1348 if (from == NORMAL && to == HOT) { |
| 1349 animation->Show(); | 1349 animation->Show(); |
| 1350 } else if (from == HOT && to == NORMAL) { | 1350 } else if (from == HOT && to == NORMAL) { |
| 1351 animation->Hide(); | 1351 animation->Hide(); |
| 1352 } else if (from != to) { | 1352 } else if (from != to) { |
| 1353 animation->Reset((to == HOT) ? 1.0 : 0.0); | 1353 animation->Reset((to == HOT) ? 1.0 : 0.0); |
| 1354 } | 1354 } |
| 1355 } | 1355 } |
| OLD | NEW |