| 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 "ash/system/drive/tray_drive.h" | 5 #include "ash/system/drive/tray_drive.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/metrics/user_metrics_recorder.h" | 9 #include "ash/metrics/user_metrics_recorder.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 } | 122 } |
| 123 | 123 |
| 124 private: | 124 private: |
| 125 | 125 |
| 126 class OperationProgressBar : public views::ProgressBar { | 126 class OperationProgressBar : public views::ProgressBar { |
| 127 public: | 127 public: |
| 128 OperationProgressBar() {} | 128 OperationProgressBar() {} |
| 129 private: | 129 private: |
| 130 | 130 |
| 131 // Overridden from View: | 131 // Overridden from View: |
| 132 virtual gfx::Size GetPreferredSize() OVERRIDE { | 132 virtual gfx::Size GetPreferredSize() const OVERRIDE { |
| 133 return gfx::Size(kProgressBarWidth, kProgressBarHeight); | 133 return gfx::Size(kProgressBarWidth, kProgressBarHeight); |
| 134 } | 134 } |
| 135 | 135 |
| 136 DISALLOW_COPY_AND_ASSIGN(OperationProgressBar); | 136 DISALLOW_COPY_AND_ASSIGN(OperationProgressBar); |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 class RowView : public HoverHighlightView, | 139 class RowView : public HoverHighlightView, |
| 140 public views::ButtonListener { | 140 public views::ButtonListener { |
| 141 public: | 141 public: |
| 142 RowView(DriveDetailedView* parent, | 142 RowView(DriveDetailedView* parent, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 status_img_->SetImage(container_->GetImageForState(state)); | 191 status_img_->SetImage(container_->GetImageForState(state)); |
| 192 progress_bar_->SetValue(progress); | 192 progress_bar_->SetValue(progress); |
| 193 cancel_button_->SetVisible( | 193 cancel_button_->SetVisible( |
| 194 state == ash::DriveOperationStatus::OPERATION_NOT_STARTED || | 194 state == ash::DriveOperationStatus::OPERATION_NOT_STARTED || |
| 195 state == ash::DriveOperationStatus::OPERATION_IN_PROGRESS); | 195 state == ash::DriveOperationStatus::OPERATION_IN_PROGRESS); |
| 196 } | 196 } |
| 197 | 197 |
| 198 private: | 198 private: |
| 199 | 199 |
| 200 // views::View overrides. | 200 // views::View overrides. |
| 201 virtual gfx::Size GetPreferredSize() OVERRIDE { | 201 virtual gfx::Size GetPreferredSize() const OVERRIDE { |
| 202 return gfx::Size( | 202 return gfx::Size( |
| 203 status_img_->GetPreferredSize().width() + | 203 status_img_->GetPreferredSize().width() + |
| 204 label_container_->GetPreferredSize().width() + | 204 label_container_->GetPreferredSize().width() + |
| 205 cancel_button_->GetPreferredSize().width() + | 205 cancel_button_->GetPreferredSize().width() + |
| 206 2 * kSidePadding + 2 * kHorizontalPadding, | 206 2 * kSidePadding + 2 * kHorizontalPadding, |
| 207 std::max(status_img_->GetPreferredSize().height(), | 207 std::max(status_img_->GetPreferredSize().height(), |
| 208 std::max(label_container_->GetPreferredSize().height(), | 208 std::max(label_container_->GetPreferredSize().height(), |
| 209 cancel_button_->GetPreferredSize().height())) + | 209 cancel_button_->GetPreferredSize().height())) + |
| 210 kTopPadding + kBottomPadding); | 210 kTopPadding + kBottomPadding); |
| 211 } | 211 } |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 DriveOperationStatusList empty_list; | 508 DriveOperationStatusList empty_list; |
| 509 | 509 |
| 510 tray_view()->SetVisible(false); | 510 tray_view()->SetVisible(false); |
| 511 if (default_) | 511 if (default_) |
| 512 default_->Update(&empty_list); | 512 default_->Update(&empty_list); |
| 513 if (detailed_) | 513 if (detailed_) |
| 514 detailed_->Update(&empty_list); | 514 detailed_->Update(&empty_list); |
| 515 } | 515 } |
| 516 | 516 |
| 517 } // namespace ash | 517 } // namespace ash |
| OLD | NEW |