| 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/tray/system_tray_bubble.h" | 5 #include "ash/system/tray/system_tray_bubble.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
| 9 #include "ash/system/tray/system_tray_delegate.h" | 9 #include "ash/system/tray/system_tray_delegate.h" |
| 10 #include "ash/system/tray/system_tray_item.h" | 10 #include "ash/system/tray/system_tray_item.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // - optionally changes background color on hover. | 41 // - optionally changes background color on hover. |
| 42 class TrayPopupItemContainer : public views::View { | 42 class TrayPopupItemContainer : public views::View { |
| 43 public: | 43 public: |
| 44 TrayPopupItemContainer(views::View* view, | 44 TrayPopupItemContainer(views::View* view, |
| 45 bool change_background, | 45 bool change_background, |
| 46 bool draw_border) | 46 bool draw_border) |
| 47 : hover_(false), | 47 : hover_(false), |
| 48 change_background_(change_background) { | 48 change_background_(change_background) { |
| 49 set_notify_enter_exit_on_child(true); | 49 set_notify_enter_exit_on_child(true); |
| 50 if (draw_border) { | 50 if (draw_border) { |
| 51 set_border( | 51 SetBorder( |
| 52 views::Border::CreateSolidSidedBorder(0, 0, 1, 0, kBorderLightColor)); | 52 views::Border::CreateSolidSidedBorder(0, 0, 1, 0, kBorderLightColor)); |
| 53 } | 53 } |
| 54 views::BoxLayout* layout = new views::BoxLayout( | 54 views::BoxLayout* layout = new views::BoxLayout( |
| 55 views::BoxLayout::kVertical, 0, 0, 0); | 55 views::BoxLayout::kVertical, 0, 0, 0); |
| 56 layout->set_spread_blank_space(true); | 56 layout->set_spread_blank_space(true); |
| 57 SetLayoutManager(layout); | 57 SetLayoutManager(layout); |
| 58 SetPaintToLayer(view->layer() != NULL); | 58 SetPaintToLayer(view->layer() != NULL); |
| 59 if (view->layer()) | 59 if (view->layer()) |
| 60 SetFillsBoundsOpaquely(view->layer()->fills_bounds_opaquely()); | 60 SetFillsBoundsOpaquely(view->layer()->fills_bounds_opaquely()); |
| 61 AddChildView(view); | 61 AddChildView(view); |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 bubble_view_->AddChildView(new TrayPopupItemContainer( | 379 bubble_view_->AddChildView(new TrayPopupItemContainer( |
| 380 item_views[i], is_default_bubble, | 380 item_views[i], is_default_bubble, |
| 381 is_default_bubble && (i < item_views.size() - 2))); | 381 is_default_bubble && (i < item_views.size() - 2))); |
| 382 } | 382 } |
| 383 if (focus_view) | 383 if (focus_view) |
| 384 focus_view->RequestFocus(); | 384 focus_view->RequestFocus(); |
| 385 } | 385 } |
| 386 | 386 |
| 387 } // namespace internal | 387 } // namespace internal |
| 388 } // namespace ash | 388 } // namespace ash |
| OLD | NEW |