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 class BookmarkBarInstructionsDelegate
;
21 // BookmarkBarInstructionsView is a child of the bookmark bar that is visible
22 // when the user has no bookmarks on the bookmark bar.
23 // BookmarkBarInstructionsView shows a description of the bookmarks bar along
24 // with a link to import bookmarks. Clicking the link results in notifying the
26 class BookmarkBarInstructionsView
: public views::View
,
27 public views::LinkListener
,
28 public views::ContextMenuController
{
30 explicit BookmarkBarInstructionsView(
31 BookmarkBarInstructionsDelegate
* delegate
);
33 // views::View overrides.
34 virtual gfx::Size
GetPreferredSize() const OVERRIDE
;
35 virtual void Layout() OVERRIDE
;
36 virtual void OnThemeChanged() OVERRIDE
;
37 virtual void ViewHierarchyChanged(
38 const ViewHierarchyChangedDetails
& details
) OVERRIDE
;
39 virtual void GetAccessibleState(ui::AXViewState
* state
) OVERRIDE
;
41 // views::LinkListener overrides.
42 virtual void LinkClicked(views::Link
* source
, int event_flags
) OVERRIDE
;
45 virtual void ShowContextMenuForView(views::View
* source
,
46 const gfx::Point
& point
,
47 ui::MenuSourceType source_type
) OVERRIDE
;
51 BookmarkBarInstructionsDelegate
* delegate_
;
53 views::Label
* instructions_
;
54 views::Link
* import_link_
;
56 // The baseline of the child views. This is -1 if none of the views support a
60 // Have the colors of the child views been updated? This is initially false
61 // and set to true once we have a valid ThemeProvider.
64 DISALLOW_COPY_AND_ASSIGN(BookmarkBarInstructionsView
);
67 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_INSTRUCTIONS_VIEW_H_