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

Unified Diff: ash/system/web_notification/web_notification_tray.cc

Issue 229453005: Shelf Cleanup AlternateShelfLayout P1 Attempt 3 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 8 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/user/tray_user.cc ('k') | ash/test/shelf_view_test_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/web_notification/web_notification_tray.cc
diff --git a/ash/system/web_notification/web_notification_tray.cc b/ash/system/web_notification/web_notification_tray.cc
index 40c2539d6eb5fa60e184c22af88f14218080c8c5..13407c6c2d13958082f373ebbd07d06a4c83bdd5 100644
--- a/ash/system/web_notification/web_notification_tray.cc
+++ b/ash/system/web_notification/web_notification_tray.cc
@@ -123,11 +123,10 @@ void WorkAreaObserver::SetSystemTrayHeight(int height) {
// should be reduced by the height of shelf's shown height.
if (shelf_ && shelf_->visibility_state() == SHELF_AUTO_HIDE &&
shelf_->auto_hide_state() == SHELF_AUTO_HIDE_SHOWN) {
- system_tray_height_ -= ShelfLayoutManager::GetPreferredShelfSize() -
- ShelfLayoutManager::kAutoHideSize;
+ system_tray_height_ -= kShelfSize - ShelfLayoutManager::kAutoHideSize;
}
- if (system_tray_height_ > 0 && ash::switches::UseAlternateShelfLayout())
+ if (system_tray_height_ > 0)
system_tray_height_ += message_center::kMarginBetweenItems;
if (!shelf_)
@@ -173,8 +172,7 @@ void WorkAreaObserver::OnAutoHideStateChanged(ShelfAutoHideState new_state) {
new_state == SHELF_AUTO_HIDE_SHOWN) {
// Since the work_area is already reduced by kAutoHideSize, the inset width
// should be just the difference.
- width = ShelfLayoutManager::GetPreferredShelfSize() -
- ShelfLayoutManager::kAutoHideSize;
+ width = kShelfSize - ShelfLayoutManager::kAutoHideSize;
}
work_area.Inset(shelf_->SelectValueForShelfAlignment(
gfx::Insets(0, 0, width, 0),
@@ -219,8 +217,7 @@ class WebNotificationBubbleWrapper {
}
views::TrayBubbleView* bubble_view = views::TrayBubbleView::Create(
tray->GetBubbleWindowContainer(), anchor, tray, &init_params);
- if (ash::switches::UseAlternateShelfLayout())
- bubble_view->SetArrowPaintType(views::BubbleBorder::PAINT_NONE);
+ bubble_view->SetArrowPaintType(views::BubbleBorder::PAINT_NONE);
bubble_wrapper_.reset(new TrayBubbleWrapper(tray, bubble_view));
bubble->InitializeContents(bubble_view);
}
@@ -272,8 +269,7 @@ class WebNotificationButton : public views::CustomButton {
protected:
// Overridden from views::ImageButton:
virtual gfx::Size GetPreferredSize() OVERRIDE {
- const int notification_item_size = GetShelfItemHeight();
- return gfx::Size(notification_item_size, notification_item_size);
+ return gfx::Size(kShelfItemHeight, kShelfItemHeight);
}
virtual int GetHeightForWidth(int width) OVERRIDE {
@@ -318,7 +314,7 @@ WebNotificationTray::WebNotificationTray(StatusAreaWidget* status_area_widget)
kShellWindowId_StatusContainer),
message_center(),
message_center_tray_.get(),
- ash::switches::UseAlternateShelfLayout()));
+ true));
work_area_observer_.reset(new WorkAreaObserver());
work_area_observer_->StartObserving(
popup_collection_.get(),
@@ -344,7 +340,7 @@ bool WebNotificationTray::ShowMessageCenterInternal(bool show_settings) {
new message_center::MessageCenterBubble(
message_center(),
message_center_tray_.get(),
- ash::switches::UseAlternateShelfLayout());
+ true);
int max_height = 0;
aura::Window* status_area_window = status_area_widget()->GetNativeView();
@@ -372,7 +368,7 @@ bool WebNotificationTray::ShowMessageCenterInternal(bool show_settings) {
}
message_center_bubble->SetMaxHeight(std::max(0,
- max_height - GetTraySpacing()));
+ max_height - kTraySpacing));
if (show_settings)
message_center_bubble->SetSettingsVisible();
message_center_bubble_.reset(
« no previous file with comments | « ash/system/user/tray_user.cc ('k') | ash/test/shelf_view_test_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698