| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/toast/toast_overlay.h" | 5 #include "ash/system/toast/toast_overlay.h" |
| 6 | 6 |
| 7 #include "ash/common/shell_window_ids.h" | 7 #include "ash/common/shell_window_ids.h" |
| 8 #include "ash/screen_util.h" | 8 #include "ash/screen_util.h" |
| 9 #include "ash/shelf/shelf.h" | 9 #include "ash/shelf/shelf.h" |
| 10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 friend class ToastOverlay; // for ToastOverlay::ClickDismissButtonForTesting. | 97 friend class ToastOverlay; // for ToastOverlay::ClickDismissButtonForTesting. |
| 98 | 98 |
| 99 DISALLOW_COPY_AND_ASSIGN(ToastOverlayButton); | 99 DISALLOW_COPY_AND_ASSIGN(ToastOverlayButton); |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 ToastOverlayButton::ToastOverlayButton(views::ButtonListener* listener, | 102 ToastOverlayButton::ToastOverlayButton(views::ButtonListener* listener, |
| 103 const base::string16& text) | 103 const base::string16& text) |
| 104 : views::LabelButton(listener, text) { | 104 : views::LabelButton(listener, text) { |
| 105 SetHasInkDrop(true); | 105 SetHasInkDrop(INK_DROP_WITH_GESTURE_HANDLING); |
| 106 set_has_ink_drop_action_on_click(true); | 106 set_has_ink_drop_action_on_click(true); |
| 107 set_ink_drop_base_color(SK_ColorWHITE); | 107 set_ink_drop_base_color(SK_ColorWHITE); |
| 108 | 108 |
| 109 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 109 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
| 110 | 110 |
| 111 SetEnabledTextColors(kButtonTextColor); | 111 SetEnabledTextColors(kButtonTextColor); |
| 112 SetFontList(rb->GetFontList(kTextFontStyle)); | 112 SetFontList(rb->GetFontList(kTextFontStyle)); |
| 113 | 113 |
| 114 // Treat the space below the baseline as a margin. | 114 // Treat the space below the baseline as a margin. |
| 115 int verticalSpacing = kToastVerticalSpacing - | 115 int verticalSpacing = kToastVerticalSpacing - |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 277 |
| 278 views::Widget* ToastOverlay::widget_for_testing() { | 278 views::Widget* ToastOverlay::widget_for_testing() { |
| 279 return overlay_widget_.get(); | 279 return overlay_widget_.get(); |
| 280 } | 280 } |
| 281 | 281 |
| 282 void ToastOverlay::ClickDismissButtonForTesting(const ui::Event& event) { | 282 void ToastOverlay::ClickDismissButtonForTesting(const ui::Event& event) { |
| 283 overlay_view_->button()->NotifyClick(event); | 283 overlay_view_->button()->NotifyClick(event); |
| 284 } | 284 } |
| 285 | 285 |
| 286 } // namespace ash | 286 } // namespace ash |
| OLD | NEW |