Chromium Code Reviews| 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/web_notification/web_notification_tray.h" | 5 #include "ash/system/web_notification/web_notification_tray.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
| 10 #include "ash/shelf/shelf_layout_manager_observer.h" | 10 #include "ash/shelf/shelf_layout_manager_observer.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 246 message_center_tray_.get(), | 246 message_center_tray_.get(), |
| 247 true); | 247 true); |
| 248 | 248 |
| 249 // Assume the status area and bubble bottoms are aligned when vertical. | 249 // Assume the status area and bubble bottoms are aligned when vertical. |
| 250 aura::Window* status_area_window = status_area_widget()->GetNativeView(); | 250 aura::Window* status_area_window = status_area_widget()->GetNativeView(); |
| 251 const int max_height = | 251 const int max_height = |
| 252 wm::IsHorizontalAlignment(GetShelfLayoutManager()->GetAlignment()) | 252 wm::IsHorizontalAlignment(GetShelfLayoutManager()->GetAlignment()) |
| 253 ? GetShelfLayoutManager()->GetIdealBounds().y() | 253 ? GetShelfLayoutManager()->GetIdealBounds().y() |
| 254 : status_area_window->GetBoundsInRootWindow().bottom(); | 254 : status_area_window->GetBoundsInRootWindow().bottom(); |
| 255 | 255 |
| 256 message_center_bubble->SetMaxHeight(std::max(0, max_height - kTraySpacing)); | 256 message_center_bubble->SetMaxHeight( |
| 257 std::max(0, max_height - kMessageCenterBubblePadding)); | |
|
tdanderson
2016/05/26 22:55:56
I could be mistaken but shouldn't this still be Ge
yiyix
2016/06/02 03:54:54
You are right.
| |
| 257 if (show_settings) | 258 if (show_settings) |
| 258 message_center_bubble->SetSettingsVisible(); | 259 message_center_bubble->SetSettingsVisible(); |
| 259 message_center_bubble_.reset( | 260 message_center_bubble_.reset( |
| 260 new WebNotificationBubbleWrapper(this, message_center_bubble)); | 261 new WebNotificationBubbleWrapper(this, message_center_bubble)); |
| 261 | 262 |
| 262 status_area_widget()->SetHideSystemNotifications(true); | 263 status_area_widget()->SetHideSystemNotifications(true); |
| 263 GetShelfLayoutManager()->UpdateAutoHideState(); | 264 GetShelfLayoutManager()->UpdateAutoHideState(); |
| 264 button_->SetBubbleVisible(true); | 265 button_->SetBubbleVisible(true); |
| 265 SetDrawBackgroundAsActive(true); | 266 SetDrawBackgroundAsActive(true); |
| 266 return true; | 267 return true; |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 504 | 505 |
| 505 message_center::MessageCenterBubble* | 506 message_center::MessageCenterBubble* |
| 506 WebNotificationTray::GetMessageCenterBubbleForTest() { | 507 WebNotificationTray::GetMessageCenterBubbleForTest() { |
| 507 if (!message_center_bubble()) | 508 if (!message_center_bubble()) |
| 508 return NULL; | 509 return NULL; |
| 509 return static_cast<message_center::MessageCenterBubble*>( | 510 return static_cast<message_center::MessageCenterBubble*>( |
| 510 message_center_bubble()->bubble()); | 511 message_center_bubble()->bubble()); |
| 511 } | 512 } |
| 512 | 513 |
| 513 } // namespace ash | 514 } // namespace ash |
| OLD | NEW |