Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_SUBTLE_NOTIFICATION_VIEW_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_SUBTLE_NOTIFICATION_VIEW_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "base/strings/string16.h" | |
| 10 #include "ui/gfx/native_widget_types.h" | |
| 11 #include "ui/views/view.h" | |
| 12 | |
| 13 namespace views { | |
| 14 class Link; | |
| 15 class LinkListener; | |
| 16 class Widget; | |
| 17 } | |
| 18 | |
| 19 // A transient, transparent notification bubble that appears at the top of the | |
| 20 // browser window to give the user a short instruction (e.g., "Press Esc to exit | |
| 21 // full screen"). Unlike a full notification, a subtle notification | |
| 22 // auto-dismisses after a short period of time. It also has special | |
| 23 // functionality for displaying keyboard shortcuts (rendering the keys inside a | |
| 24 // rounded rectangle). | |
| 25 class SubtleNotificationView : public views::View { | |
| 26 public: | |
| 27 SubtleNotificationView(const base::string16& instruction_text, | |
| 28 const base::string16& link_text, | |
| 29 views::LinkListener* link_listener); | |
| 30 ~SubtleNotificationView() override; | |
| 31 | |
| 32 void UpdateContent(const base::string16& instruction_text, | |
| 33 const base::string16& link_text); | |
| 34 | |
| 35 // Creates a Widget containing a SubtleNotificationView. If |accept_events|, | |
| 36 // 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
| |
| 37 // if not, events will go through to the underlying window. | |
| 38 static views::Widget* CreatePopupWidget(gfx::NativeView parent_view, | |
| 39 SubtleNotificationView* view, | |
| 40 bool accept_events); | |
| 41 | |
| 42 private: | |
| 43 class InstructionView; | |
| 44 | |
| 45 // 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.
| |
| 46 // only.) | |
| 47 views::Link* link_; | |
| 48 // 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.
| |
| 49 // no link (always present in simplified mode). | |
| 50 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.
| |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(SubtleNotificationView); | |
| 53 }; | |
| 54 | |
| 55 #endif // CHROME_BROWSER_UI_VIEWS_SUBTLE_NOTIFICATION_VIEW_H_ | |
| OLD | NEW |