| 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/screen_util.h" | 7 #include "ash/screen_util.h" |
| 8 #include "ash/shelf/shelf.h" | 8 #include "ash/shelf/shelf.h" |
| 9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 DISALLOW_COPY_AND_ASSIGN(ToastOverlayLabel); | 71 DISALLOW_COPY_AND_ASSIGN(ToastOverlayLabel); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 ToastOverlayLabel::ToastOverlayLabel(const std::string& label) { | 74 ToastOverlayLabel::ToastOverlayLabel(const std::string& label) { |
| 75 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 75 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
| 76 | 76 |
| 77 SetText(base::UTF8ToUTF16(label)); | 77 SetText(base::UTF8ToUTF16(label)); |
| 78 SetHorizontalAlignment(gfx::ALIGN_LEFT); | 78 SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 79 SetFontList(rb->GetFontList(kTextFontStyle)); | 79 SetFontList(rb->GetFontList(kTextFontStyle)); |
| 80 SetAutoColorReadabilityEnabled(false); | 80 SetAutoColorReadabilityEnabled(false); |
| 81 SetFocusable(false); | |
| 82 SetMultiLine(true); | 81 SetMultiLine(true); |
| 83 SetEnabledColor(SK_ColorWHITE); | 82 SetEnabledColor(SK_ColorWHITE); |
| 84 SetDisabledColor(SK_ColorWHITE); | 83 SetDisabledColor(SK_ColorWHITE); |
| 85 SetSubpixelRenderingEnabled(false); | 84 SetSubpixelRenderingEnabled(false); |
| 86 } | 85 } |
| 87 | 86 |
| 88 ToastOverlayLabel::~ToastOverlayLabel() {} | 87 ToastOverlayLabel::~ToastOverlayLabel() {} |
| 89 | 88 |
| 90 void ToastOverlayLabel::SetMaximumWidth(int width) { | 89 void ToastOverlayLabel::SetMaximumWidth(int width) { |
| 91 maximum_width_ = width; | 90 maximum_width_ = width; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 | 277 |
| 279 views::Widget* ToastOverlay::widget_for_testing() { | 278 views::Widget* ToastOverlay::widget_for_testing() { |
| 280 return overlay_widget_.get(); | 279 return overlay_widget_.get(); |
| 281 } | 280 } |
| 282 | 281 |
| 283 void ToastOverlay::ClickDismissButtonForTesting(const ui::Event& event) { | 282 void ToastOverlay::ClickDismissButtonForTesting(const ui::Event& event) { |
| 284 overlay_view_->button()->NotifyClick(event); | 283 overlay_view_->button()->NotifyClick(event); |
| 285 } | 284 } |
| 286 | 285 |
| 287 } // namespace ash | 286 } // namespace ash |
| OLD | NEW |