Lines Matching refs:tray

5 #include "ash/system/tray/system_tray.h"
15 #include "ash/system/tray/system_tray_item.h"
16 #include "ash/system/tray/tray_constants.h"
112 // Trivial item implementation that returns NULL from tray/default/detailed
163 SystemTray* tray = GetSystemTray();
164 ASSERT_TRUE(tray->GetWidget());
166 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
169 ASSERT_TRUE(tray->CloseSystemBubble());
171 ASSERT_FALSE(tray->CloseSystemBubble());
174 // Opening and closing the bubble should change the coloring of the tray.
176 SystemTray* tray = GetSystemTray();
177 ASSERT_TRUE(tray->GetWidget());
178 // At the beginning the tray coloring is not active.
179 ASSERT_FALSE(tray->draw_background_as_active());
182 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
183 ASSERT_TRUE(tray->draw_background_as_active());
186 ASSERT_TRUE(tray->CloseSystemBubble());
188 ASSERT_FALSE(tray->draw_background_as_active());
192 // system tray coloring back to normal.
194 SystemTray* tray = GetSystemTray();
195 ASSERT_TRUE(tray->GetWidget());
199 // At the beginning the tray coloring is not active.
200 ASSERT_FALSE(tray->draw_background_as_active());
203 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
204 ASSERT_TRUE(tray->draw_background_as_active());
209 ASSERT_FALSE(tray->draw_background_as_active());
212 ASSERT_FALSE(tray->CloseSystemBubble());
216 SystemTray* tray = GetSystemTray();
217 ASSERT_TRUE(tray->GetWidget());
221 tray->AddTrayItem(test_item);
222 tray->AddTrayItem(detailed_item);
225 const std::vector<SystemTrayItem*>& items = tray->GetTrayItems();
231 // Ensure the tray views are created.
236 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
241 tray->ShowDetailedView(detailed_item, 0, false, BUBBLE_CREATE_NEW);
247 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
254 SystemTray* tray = GetSystemTray();
255 ASSERT_TRUE(tray->GetWidget());
259 tray->AddTrayItem(no_view_item);
260 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
261 tray->ShowDetailedView(no_view_item, 0, false, BUBBLE_USE_EXISTING);
266 SystemTray* tray = GetSystemTray();
267 ASSERT_TRUE(tray->GetWidget());
269 // Add an initial tray item so that the tray gets laid out correctly.
271 tray->AddTrayItem(initial_item);
273 gfx::Size initial_size = tray->GetWidget()->GetWindowBoundsInScreen().size();
276 tray->AddTrayItem(new_item);
278 gfx::Size new_size = tray->GetWidget()->GetWindowBoundsInScreen().size();
280 // Adding the new item should change the size of the tray.
283 // Hiding the tray view of the new item should also change the size of the
284 // tray.
287 tray->GetWidget()->GetWindowBoundsInScreen().size().ToString());
291 tray->GetWidget()->GetWindowBoundsInScreen().size().ToString());
295 SystemTray* tray = GetSystemTray();
296 ASSERT_TRUE(tray->GetWidget());
300 tray->AddTrayItem(test_item);
301 tray->AddTrayItem(detailed_item);
303 // Ensure the tray views are created.
308 tray->ShowNotificationView(test_item);
312 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
317 tray->ShowDetailedView(detailed_item, 0, false, BUBBLE_CREATE_NEW);
323 ASSERT_TRUE(tray->CloseSystemBubble());
330 SystemTray* tray = GetSystemTray();
331 ASSERT_TRUE(tray->GetWidget());
334 tray->AddTrayItem(test_item);
336 // Ensure the tray views are created.
340 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
346 tray->ShowDetailedView(test_item, 0, true, BUBBLE_USE_EXISTING);
355 tray->ShowDefaultView(BUBBLE_USE_EXISTING);
363 // Tests that the tray is laid out properly and is fully contained within
370 SystemTray* tray = widget->system_tray();
375 gfx::Rect tray_bounds = tray->GetBoundsInScreen();
384 tray_bounds = tray->GetBoundsInScreen();
393 tray_bounds = tray->GetBoundsInScreen();
401 SystemTray* tray = GetSystemTray();
402 ASSERT_TRUE(tray->GetWidget());
405 tray->AddTrayItem(test_item);
411 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
412 ASSERT_TRUE(tray->HasSystemBubble());
415 ASSERT_FALSE(tray->HasSystemBubble());
417 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
418 ASSERT_TRUE(tray->HasSystemBubble());
423 ASSERT_FALSE(tray->HasSystemBubble());
427 tray->ShowPersistentDefaultView();
428 ASSERT_TRUE(tray->HasSystemBubble());
431 ASSERT_TRUE(tray->HasSystemBubble());
437 ASSERT_TRUE(tray->HasSystemBubble());
442 // Accessibility/Settings tray items are available only on cros.
458 SystemTray* tray = GetSystemTray();
459 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
461 ASSERT_TRUE(tray->HasSystemBubble());
463 tray->GetSystemBubble()->bubble_view()->GetViewByID(
467 EXPECT_FALSE(tray->GetSystemBubble()->bubble_view()->GetViewByID(
472 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
475 accessibility = tray->GetSystemBubble()->bubble_view()->GetViewByID(
481 tray->GetSystemBubble()->bubble_view()->GetViewByID(
488 // tray becomes visible, and stops animating to hidden.
490 SystemTray* tray = GetSystemTray();
491 ASSERT_TRUE(tray->visible());
497 tray->SetVisible(false);
498 EXPECT_TRUE(tray->visible());
499 EXPECT_EQ(0.0f, tray->layer()->GetTargetOpacity());
501 tray->SetVisible(true);
503 tray->layer()->GetAnimator()->StopAnimating();
504 EXPECT_TRUE(tray->visible());
505 EXPECT_EQ(1.0f, tray->layer()->GetTargetOpacity());