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

Side by Side 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: Avoid dependency patch set. 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 unified diff | Download patch
OLDNEW
(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 explicit SubtleNotificationView(views::LinkListener* link_listener);
28 ~SubtleNotificationView() override;
29
30 void UpdateContent(const base::string16& instruction_text,
31 const base::string16& link_text);
32
33 // Creates a Widget containing a SubtleNotificationView. If |accept_events|,
34 // the bubble will intercept mouse events (required if there is a clickable
35 // link); if not, events will go through to the underlying window.
36 static views::Widget* CreatePopupWidget(gfx::NativeView parent_view,
37 SubtleNotificationView* view,
38 bool accept_events);
39
40 private:
41 class InstructionView;
42
43 // Text displayed in the bubble, with optional keyboard keys.
44 InstructionView* instruction_view_;
45 // Clickable text link. If there is also an instruction view, this appears
46 // after the instruction text.
47 views::Link* link_;
48
49 DISALLOW_COPY_AND_ASSIGN(SubtleNotificationView);
50 };
51
52 #endif // CHROME_BROWSER_UI_VIEWS_SUBTLE_NOTIFICATION_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/exclusive_access_bubble_views.cc ('k') | chrome/browser/ui/views/subtle_notification_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698