Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2847)

Unified Diff: ash/common/system/toast/toast_overlay.h

Issue 2506583005: Hide dismiss button on toast when doing partial screenshot using stylus tools. (Closed)
Patch Set: Add DCHECK Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/system/toast/toast_data.cc ('k') | ash/common/system/toast/toast_overlay.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/toast/toast_overlay.h
diff --git a/ash/common/system/toast/toast_overlay.h b/ash/common/system/toast/toast_overlay.h
index ea2bb391a75349878f3f595f142aee40d5c07f51..4d3fe97fc8a720d81dcf6cd68286c31d9e56864f 100644
--- a/ash/common/system/toast/toast_overlay.h
+++ b/ash/common/system/toast/toast_overlay.h
@@ -8,6 +8,7 @@
#include <memory>
#include "ash/ash_export.h"
+#include "base/optional.h"
#include "base/strings/string16.h"
#include "ui/compositor/layer_animation_observer.h"
#include "ui/events/event.h"
@@ -38,10 +39,12 @@ class ASH_EXPORT ToastOverlay : public ui::ImplicitAnimationObserver {
// Creates the Toast overlay UI. |text| is the message to be shown, and
// |dismiss_text| is the message for the button to dismiss the toast message.
- // |dismiss_text| is optional. If empty, the default text is used.
+ // If |dismiss_text| is null, no dismiss button will be shown. If
+ // |dismiss_text| has a value but the string is empty, the default text is
+ // used.
ToastOverlay(Delegate* delegate,
const base::string16& text,
- const base::string16& dismiss_text);
+ base::Optional<base::string16> dismiss_text);
~ToastOverlay() override;
// Shows or hides the overlay.
@@ -58,11 +61,12 @@ class ASH_EXPORT ToastOverlay : public ui::ImplicitAnimationObserver {
void OnImplicitAnimationsCompleted() override;
views::Widget* widget_for_testing();
+ ToastOverlayButton* dismiss_button_for_testing();
void ClickDismissButtonForTesting(const ui::Event& event);
Delegate* const delegate_;
const base::string16 text_;
- const base::string16 dismiss_text_;
+ const base::Optional<base::string16> dismiss_text_;
std::unique_ptr<views::Widget> overlay_widget_;
std::unique_ptr<ToastOverlayView> overlay_view_;
gfx::Size widget_size_;
« no previous file with comments | « ash/common/system/toast/toast_data.cc ('k') | ash/common/system/toast/toast_overlay.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698