OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/prefs/pref_change_registrar.h" | 15 #include "base/prefs/pref_change_registrar.h" |
16 #include "chrome/browser/bookmarks/bookmark_stats.h" | 16 #include "chrome/browser/bookmarks/bookmark_stats.h" |
17 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" | 17 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
18 #include "chrome/browser/ui/bookmarks/bookmark_bar_instructions_delegate.h" | 18 #include "chrome/browser/ui/bookmarks/bookmark_bar_instructions_delegate.h" |
19 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view_observer.h" | 19 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view_observer.h" |
20 #include "chrome/browser/ui/views/bookmarks/bookmark_menu_controller_observer.h" | 20 #include "chrome/browser/ui/views/bookmarks/bookmark_menu_controller_observer.h" |
21 #include "chrome/browser/ui/views/detachable_toolbar_view.h" | 21 #include "chrome/browser/ui/views/detachable_toolbar_view.h" |
22 #include "components/bookmarks/core/browser/bookmark_model_observer.h" | 22 #include "components/bookmarks/core/browser/bookmark_model_observer.h" |
23 #include "components/bookmarks/core/browser/bookmark_node_data.h" | 23 #include "components/bookmarks/core/browser/bookmark_node_data.h" |
24 #include "ui/gfx/animation/animation_delegate.h" | 24 #include "ui/gfx/animation/animation_delegate.h" |
25 #include "ui/views/context_menu_controller.h" | 25 #include "ui/views/context_menu_controller.h" |
26 #include "ui/views/controls/button/button.h" | 26 #include "ui/views/controls/button/button.h" |
27 #include "ui/views/controls/button/menu_button_listener.h" | 27 #include "ui/views/controls/button/menu_button_listener.h" |
28 #include "ui/views/controls/menu/menu_item_view.h" | 28 #include "ui/views/controls/menu/menu_types.h" |
29 #include "ui/views/drag_controller.h" | 29 #include "ui/views/drag_controller.h" |
30 | 30 |
31 class BookmarkContextMenu; | 31 class BookmarkContextMenu; |
32 class Browser; | 32 class Browser; |
33 class BrowserView; | 33 class BrowserView; |
34 class Profile; | 34 class Profile; |
35 | 35 |
36 namespace content { | 36 namespace content { |
37 class PageNavigator; | 37 class PageNavigator; |
38 } | 38 } |
39 | 39 |
40 namespace gfx { | 40 namespace gfx { |
41 class SlideAnimation; | 41 class SlideAnimation; |
42 } | 42 } |
43 | 43 |
44 namespace views { | 44 namespace views { |
45 class CustomButton; | 45 class CustomButton; |
46 class MenuButton; | 46 class MenuButton; |
| 47 class MenuItemView; |
47 class TextButton; | 48 class TextButton; |
48 } | 49 } |
49 | 50 |
50 // BookmarkBarView renders the BookmarkModel. Each starred entry on the | 51 // BookmarkBarView renders the BookmarkModel. Each starred entry on the |
51 // BookmarkBar is rendered as a MenuButton. An additional MenuButton aligned to | 52 // BookmarkBar is rendered as a MenuButton. An additional MenuButton aligned to |
52 // the right allows the user to quickly see recently starred entries. | 53 // the right allows the user to quickly see recently starred entries. |
53 // | 54 // |
54 // BookmarkBarView shows the bookmarks from a specific Profile. BookmarkBarView | 55 // BookmarkBarView shows the bookmarks from a specific Profile. BookmarkBarView |
55 // waits until the HistoryService for the profile has been loaded before | 56 // waits until the HistoryService for the profile has been loaded before |
56 // creating the BookmarkModel. | 57 // creating the BookmarkModel. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // returned and |model_start_index| is set to the index of the first node | 114 // returned and |model_start_index| is set to the index of the first node |
114 // contained in the overflow menu. | 115 // contained in the overflow menu. |
115 const BookmarkNode* GetNodeForButtonAtModelIndex(const gfx::Point& loc, | 116 const BookmarkNode* GetNodeForButtonAtModelIndex(const gfx::Point& loc, |
116 int* model_start_index); | 117 int* model_start_index); |
117 | 118 |
118 // Returns the MenuButton for node. | 119 // Returns the MenuButton for node. |
119 views::MenuButton* GetMenuButtonForNode(const BookmarkNode* node); | 120 views::MenuButton* GetMenuButtonForNode(const BookmarkNode* node); |
120 | 121 |
121 // Returns the position to anchor the menu for |button| at. | 122 // Returns the position to anchor the menu for |button| at. |
122 void GetAnchorPositionForButton(views::MenuButton* button, | 123 void GetAnchorPositionForButton(views::MenuButton* button, |
123 views::MenuItemView::AnchorPosition* anchor); | 124 views::MenuAnchorPosition* anchor); |
124 | 125 |
125 // Returns the button responsible for showing bookmarks in the other bookmark | 126 // Returns the button responsible for showing bookmarks in the other bookmark |
126 // folder. | 127 // folder. |
127 views::MenuButton* other_bookmarked_button() const { | 128 views::MenuButton* other_bookmarked_button() const { |
128 return other_bookmarked_button_; | 129 return other_bookmarked_button_; |
129 } | 130 } |
130 | 131 |
131 // Returns the button used when not all the items on the bookmark bar fit. | 132 // Returns the button used when not all the items on the bookmark bar fit. |
132 views::MenuButton* overflow_button() const { return overflow_button_; } | 133 views::MenuButton* overflow_button() const { return overflow_button_; } |
133 | 134 |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 | 434 |
434 BookmarkBar::State bookmark_bar_state_; | 435 BookmarkBar::State bookmark_bar_state_; |
435 | 436 |
436 // Are we animating to or from the detached state? | 437 // Are we animating to or from the detached state? |
437 bool animating_detached_; | 438 bool animating_detached_; |
438 | 439 |
439 DISALLOW_COPY_AND_ASSIGN(BookmarkBarView); | 440 DISALLOW_COPY_AND_ASSIGN(BookmarkBarView); |
440 }; | 441 }; |
441 | 442 |
442 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_ | 443 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_ |
OLD | NEW |