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

Unified Diff: chrome/browser/ui/views/subtle_notification_view.h

Issue 1979193002: Factor ExclusiveAccessView out to SubtleNotificationView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fullscreen-remove-old-theming-code
Patch Set: Remove unnecessary TODO. Created 4 years, 7 months 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
Index: chrome/browser/ui/views/subtle_notification_view.h
diff --git a/chrome/browser/ui/views/subtle_notification_view.h b/chrome/browser/ui/views/subtle_notification_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..ecf74dab112bbb81fe35b7b5f77d542c3798dc1b
--- /dev/null
+++ b/chrome/browser/ui/views/subtle_notification_view.h
@@ -0,0 +1,55 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_VIEWS_SUBTLE_NOTIFICATION_VIEW_H_
+#define CHROME_BROWSER_UI_VIEWS_SUBTLE_NOTIFICATION_VIEW_H_
+
+#include "base/macros.h"
+#include "base/strings/string16.h"
+#include "ui/gfx/native_widget_types.h"
+#include "ui/views/view.h"
+
+namespace views {
+class Link;
+class LinkListener;
+class Widget;
+}
+
+// A transient, transparent notification bubble that appears at the top of the
+// browser window to give the user a short instruction (e.g., "Press Esc to exit
+// full screen"). Unlike a full notification, a subtle notification
+// auto-dismisses after a short period of time. It also has special
+// functionality for displaying keyboard shortcuts (rendering the keys inside a
+// rounded rectangle).
+class SubtleNotificationView : public views::View {
+ public:
+ SubtleNotificationView(const base::string16& instruction_text,
+ const base::string16& link_text,
+ views::LinkListener* link_listener);
+ ~SubtleNotificationView() override;
+
+ void UpdateContent(const base::string16& instruction_text,
+ const base::string16& link_text);
+
+ // Creates a Widget containing a SubtleNotificationView. If |accept_events|,
+ // the bubble will block mouse events (required if there is a clickable link);
msw 2016/05/18 18:38:32 nit: s/block/handle/
Matt Giuca 2016/05/19 01:50:32 Intercept (compromise). I was trying to get across
+ // if not, events will go through to the underlying window.
+ static views::Widget* CreatePopupWidget(gfx::NativeView parent_view,
+ SubtleNotificationView* view,
+ bool accept_events);
+
+ private:
+ class InstructionView;
+
+ // Clickable hint text for exiting fullscreen mode. (Non-simplified mode
msw 2016/05/18 18:38:32 nit: remove "for exiting fullscreen mode"?
Matt Giuca 2016/05/19 01:50:32 Done.
+ // only.)
+ views::Link* link_;
+ // Instruction for exiting fullscreen / mouse lock. Only present if there is
msw 2016/05/18 18:38:32 nit: remove "for exiting fullscreen / mouse lock"?
Matt Giuca 2016/05/19 01:50:32 Done.
+ // no link (always present in simplified mode).
+ InstructionView* exit_instruction_;
msw 2016/05/18 18:38:32 nit: rename |instruction_view_| or similar (not ex
Matt Giuca 2016/05/19 01:50:32 Done.
+
+ DISALLOW_COPY_AND_ASSIGN(SubtleNotificationView);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_SUBTLE_NOTIFICATION_VIEW_H_

Powered by Google App Engine
This is Rietveld 408576698