Add a minor text member to ui::MenuModel.
[chromium-blink-merge.git] / chrome / browser / ui / views / bookmarks / bookmark_bar_instructions_view.h
blobf9a880455d2531b104c33070d8352b3b0d5b59c7
1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_INSTRUCTIONS_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_INSTRUCTIONS_VIEW_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "ui/views/context_menu_controller.h"
11 #include "ui/views/controls/link_listener.h"
12 #include "ui/views/view.h"
14 namespace chrome {
15 class BookmarkBarInstructionsDelegate;
18 namespace views {
19 class Label;
20 class Link;
23 // BookmarkBarInstructionsView is a child of the bookmark bar that is visible
24 // when the user has no bookmarks on the bookmark bar.
25 // BookmarkBarInstructionsView shows a description of the bookmarks bar along
26 // with a link to import bookmarks. Clicking the link results in notifying the
27 // delegate.
28 class BookmarkBarInstructionsView : public views::View,
29 public views::LinkListener,
30 public views::ContextMenuController {
31 public:
32 explicit BookmarkBarInstructionsView(
33 chrome::BookmarkBarInstructionsDelegate* delegate);
35 // views::View overrides.
36 virtual gfx::Size GetPreferredSize() OVERRIDE;
37 virtual void Layout() OVERRIDE;
38 virtual void OnThemeChanged() OVERRIDE;
39 virtual void ViewHierarchyChanged(
40 const ViewHierarchyChangedDetails& details) OVERRIDE;
41 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
43 // views::LinkListener overrides.
44 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE;
46 private:
47 virtual void ShowContextMenuForView(views::View* source,
48 const gfx::Point& point,
49 ui::MenuSourceType source_type) OVERRIDE;
51 void UpdateColors();
53 chrome::BookmarkBarInstructionsDelegate* delegate_;
55 views::Label* instructions_;
56 views::Link* import_link_;
58 // The baseline of the child views. This is -1 if none of the views support a
59 // baseline.
60 int baseline_;
62 // Have the colors of the child views been updated? This is initially false
63 // and set to true once we have a valid ThemeProvider.
64 bool updated_colors_;
66 DISALLOW_COPY_AND_ASSIGN(BookmarkBarInstructionsView);
69 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_INSTRUCTIONS_VIEW_H_