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

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

Issue 198063003: Revert of Shelf Cleanup (- binary files) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 6df4d9def54b00636f94373d4804fc51473fedd2..e1431433c333bc9dce537f4ba50a60858da6df1f 100644
--- a/ash/system/web_notification/web_notification_tray.cc
+++ b/ash/system/web_notification/web_notification_tray.cc
@@ -124,10 +124,11 @@
// 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_ -= kShelfSize - ShelfLayoutManager::kAutoHideSize;
- }
-
- if (system_tray_height_ > 0)
+ system_tray_height_ -= ShelfLayoutManager::GetPreferredShelfSize() -
+ ShelfLayoutManager::kAutoHideSize;
+ }
+
+ if (system_tray_height_ > 0 && ash::switches::UseAlternateShelfLayout())
system_tray_height_ += message_center::kMarginBetweenItems;
if (!shelf_)
@@ -173,7 +174,8 @@
new_state == SHELF_AUTO_HIDE_SHOWN) {
// Since the work_area is already reduced by kAutoHideSize, the inset width
// should be just the difference.
- width = kShelfSize - ShelfLayoutManager::kAutoHideSize;
+ width = ShelfLayoutManager::GetPreferredShelfSize() -
+ ShelfLayoutManager::kAutoHideSize;
}
work_area.Inset(shelf_->SelectValueForShelfAlignment(
gfx::Insets(0, 0, width, 0),
@@ -218,7 +220,8 @@
}
views::TrayBubbleView* bubble_view = views::TrayBubbleView::Create(
tray->GetBubbleWindowContainer(), anchor, tray, &init_params);
- bubble_view->SetArrowPaintType(views::BubbleBorder::PAINT_NONE);
+ if (ash::switches::UseAlternateShelfLayout())
+ bubble_view->SetArrowPaintType(views::BubbleBorder::PAINT_NONE);
bubble_wrapper_.reset(new TrayBubbleWrapper(tray, bubble_view));
bubble->InitializeContents(bubble_view);
}
@@ -270,7 +273,8 @@
protected:
// Overridden from views::ImageButton:
virtual gfx::Size GetPreferredSize() OVERRIDE {
- return gfx::Size(kShelfItemHeight, kShelfItemHeight);
+ const int notification_item_size = GetShelfItemHeight();
+ return gfx::Size(notification_item_size, notification_item_size);
}
virtual int GetHeightForWidth(int width) OVERRIDE {
@@ -318,7 +322,7 @@
internal::kShellWindowId_StatusContainer),
message_center(),
message_center_tray_.get(),
- true));
+ ash::switches::UseAlternateShelfLayout()));
work_area_observer_.reset(new internal::WorkAreaObserver());
work_area_observer_->StartObserving(
popup_collection_.get(),
@@ -344,7 +348,7 @@
new message_center::MessageCenterBubble(
message_center(),
message_center_tray_.get(),
- true);
+ ash::switches::UseAlternateShelfLayout());
int max_height = 0;
aura::Window* status_area_window = status_area_widget()->GetNativeView();
@@ -372,7 +376,7 @@
}
message_center_bubble->SetMaxHeight(std::max(0,
- max_height - kTraySpacing));
+ max_height - GetTraySpacing()));
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