Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(960)

Unified Diff: ash/system/drive/tray_drive.cc

Issue 10384178: ash: Make sure all the sub-popups retain the same height as the main popup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/bluetooth/tray_bluetooth.cc ('k') | ash/system/ime/tray_ime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/drive/tray_drive.cc
diff --git a/ash/system/drive/tray_drive.cc b/ash/system/drive/tray_drive.cc
index 3bdbd3026a6b869f0aa9fe4e4069dfe9d68edf6f..813053dd9e9a31ac88239cc14fdd36a4ba167fe4 100644
--- a/ash/system/drive/tray_drive.cc
+++ b/ash/system/drive/tray_drive.cc
@@ -10,6 +10,7 @@
#include "ash/system/tray/system_tray.h"
#include "ash/system/tray/system_tray_delegate.h"
#include "ash/system/tray/tray_constants.h"
+#include "ash/system/tray/tray_details_view.h"
#include "ash/system/tray/tray_item_more.h"
#include "ash/system/tray/tray_item_view.h"
#include "ash/system/tray/tray_views.h"
@@ -86,21 +87,15 @@ class DriveDefaultView : public TrayItemMore {
DISALLOW_COPY_AND_ASSIGN(DriveDefaultView);
};
-class DriveDetailedView : public views::View,
+class DriveDetailedView : public TrayDetailsView,
public ViewClickListener {
public:
DriveDetailedView(SystemTrayItem* owner,
const DriveOperationStatusList* list)
- : header_(NULL),
- operations_(NULL),
- settings_(NULL),
+ : settings_(NULL),
in_progress_img_(NULL),
done_img_(NULL),
failed_img_(NULL) {
- SetLayoutManager(new views::BoxLayout(
- views::BoxLayout::kVertical, 0, 0, 0));
- set_background(views::Background::CreateSolidBackground(kBackgroundColor));
-
in_progress_img_ = ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_AURA_UBER_TRAY_DRIVE);
done_img_ = ResourceBundle::GetSharedInstance().GetBitmapNamed(
@@ -266,11 +261,9 @@ class DriveDetailedView : public views::View,
};
void AppendHeaderEntry(const DriveOperationStatusList* list) {
- if (header_)
+ if (footer())
return;
- header_ = new SpecialPopupRow();
- header_->SetTextLabel(IDS_ASH_STATUS_TRAY_DRIVE, this);
- AddChildView(header_);
+ CreateSpecialRow(IDS_ASH_STATUS_TRAY_DRIVE, this);
}
SkBitmap* GetImageForState(ash::DriveOperationStatus::OperationState state) {
@@ -294,12 +287,8 @@ class DriveDetailedView : public views::View,
}
void AppendOperationList(const DriveOperationStatusList* list) {
- if (!operations_) {
- operations_ = new views::View;
- operations_->SetLayoutManager(new views::BoxLayout(
- views::BoxLayout::kVertical, 0, 0, 1));
- AddChildView(operations_);
- }
+ if (!scroller())
+ CreateScrollableList();
// Apply the update.
std::set<FilePath> new_set;
@@ -321,7 +310,7 @@ class DriveDetailedView : public views::View,
operation.file_path);
update_map_[operation.file_path] = row_view;
- operations_->AddChildView(row_view);
+ scroll_content()->AddChildView(row_view);
}
}
@@ -363,8 +352,8 @@ class DriveDetailedView : public views::View,
// Overridden from ViewClickListener.
virtual void ClickedOn(views::View* sender) OVERRIDE {
SystemTrayDelegate* delegate = Shell::GetInstance()->tray_delegate();
- if (sender == header_->content()) {
- Shell::GetInstance()->tray()->ShowDefaultView();
+ if (sender == footer()->content()) {
+ Shell::GetInstance()->tray()->ShowDefaultView(BUBBLE_USE_EXISTING);
} else if (sender == settings_) {
delegate->ShowDriveSettings();
}
@@ -372,8 +361,6 @@ class DriveDetailedView : public views::View,
// Maps operation entries to their file paths.
std::map<FilePath, RowView*> update_map_;
- SpecialPopupRow* header_;
- views::View* operations_;
views::View* settings_;
SkBitmap* in_progress_img_;
SkBitmap* done_img_;
« no previous file with comments | « ash/system/bluetooth/tray_bluetooth.cc ('k') | ash/system/ime/tray_ime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698