| 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_model_observer.h" | 16 #include "chrome/browser/bookmarks/bookmark_model_observer.h" |
| 17 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 17 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
| 18 #include "chrome/browser/bookmarks/bookmark_stats.h" | 18 #include "chrome/browser/bookmarks/bookmark_stats.h" |
| 19 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" | 19 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
| 20 #include "chrome/browser/ui/bookmarks/bookmark_bar_instructions_delegate.h" | 20 #include "chrome/browser/ui/bookmarks/bookmark_bar_instructions_delegate.h" |
| 21 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view_observer.h" | 21 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view_observer.h" |
| 22 #include "chrome/browser/ui/views/bookmarks/bookmark_menu_controller_observer.h" | 22 #include "chrome/browser/ui/views/bookmarks/bookmark_menu_controller_observer.h" |
| 23 #include "chrome/browser/ui/views/detachable_toolbar_view.h" | 23 #include "chrome/browser/ui/views/detachable_toolbar_view.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" | |
| 29 #include "ui/views/drag_controller.h" | 28 #include "ui/views/drag_controller.h" |
| 30 | 29 |
| 31 class BookmarkContextMenu; | 30 class BookmarkContextMenu; |
| 32 class Browser; | 31 class Browser; |
| 33 class BrowserView; | 32 class BrowserView; |
| 34 class Profile; | 33 class Profile; |
| 35 | 34 |
| 36 namespace content { | 35 namespace content { |
| 37 class PageNavigator; | 36 class PageNavigator; |
| 38 } | 37 } |
| 39 | 38 |
| 40 namespace gfx { | 39 namespace gfx { |
| 41 class SlideAnimation; | 40 class SlideAnimation; |
| 42 } | 41 } |
| 43 | 42 |
| 44 namespace views { | 43 namespace views { |
| 45 class CustomButton; | 44 class CustomButton; |
| 46 class MenuButton; | 45 class MenuButton; |
| 46 class MenuItemView; |
| 47 class TextButton; | 47 class TextButton; |
| 48 } | 48 } |
| 49 | 49 |
| 50 // BookmarkBarView renders the BookmarkModel. Each starred entry on the | 50 // BookmarkBarView renders the BookmarkModel. Each starred entry on the |
| 51 // BookmarkBar is rendered as a MenuButton. An additional MenuButton aligned to | 51 // BookmarkBar is rendered as a MenuButton. An additional MenuButton aligned to |
| 52 // the right allows the user to quickly see recently starred entries. | 52 // the right allows the user to quickly see recently starred entries. |
| 53 // | 53 // |
| 54 // BookmarkBarView shows the bookmarks from a specific Profile. BookmarkBarView | 54 // BookmarkBarView shows the bookmarks from a specific Profile. BookmarkBarView |
| 55 // waits until the HistoryService for the profile has been loaded before | 55 // waits until the HistoryService for the profile has been loaded before |
| 56 // creating the BookmarkModel. | 56 // 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 | 113 // returned and |model_start_index| is set to the index of the first node |
| 114 // contained in the overflow menu. | 114 // contained in the overflow menu. |
| 115 const BookmarkNode* GetNodeForButtonAtModelIndex(const gfx::Point& loc, | 115 const BookmarkNode* GetNodeForButtonAtModelIndex(const gfx::Point& loc, |
| 116 int* model_start_index); | 116 int* model_start_index); |
| 117 | 117 |
| 118 // Returns the MenuButton for node. | 118 // Returns the MenuButton for node. |
| 119 views::MenuButton* GetMenuButtonForNode(const BookmarkNode* node); | 119 views::MenuButton* GetMenuButtonForNode(const BookmarkNode* node); |
| 120 | 120 |
| 121 // Returns the position to anchor the menu for |button| at. | 121 // Returns the position to anchor the menu for |button| at. |
| 122 void GetAnchorPositionForButton(views::MenuButton* button, | 122 void GetAnchorPositionForButton(views::MenuButton* button, |
| 123 views::MenuItemView::AnchorPosition* anchor); | 123 ui::MenuAnchorPosition* anchor); |
| 124 | 124 |
| 125 // Returns the button responsible for showing bookmarks in the other bookmark | 125 // Returns the button responsible for showing bookmarks in the other bookmark |
| 126 // folder. | 126 // folder. |
| 127 views::MenuButton* other_bookmarked_button() const { | 127 views::MenuButton* other_bookmarked_button() const { |
| 128 return other_bookmarked_button_; | 128 return other_bookmarked_button_; |
| 129 } | 129 } |
| 130 | 130 |
| 131 // Returns the button used when not all the items on the bookmark bar fit. | 131 // Returns the button used when not all the items on the bookmark bar fit. |
| 132 views::MenuButton* overflow_button() const { return overflow_button_; } | 132 views::MenuButton* overflow_button() const { return overflow_button_; } |
| 133 | 133 |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 | 433 |
| 434 BookmarkBar::State bookmark_bar_state_; | 434 BookmarkBar::State bookmark_bar_state_; |
| 435 | 435 |
| 436 // Are we animating to or from the detached state? | 436 // Are we animating to or from the detached state? |
| 437 bool animating_detached_; | 437 bool animating_detached_; |
| 438 | 438 |
| 439 DISALLOW_COPY_AND_ASSIGN(BookmarkBarView); | 439 DISALLOW_COPY_AND_ASSIGN(BookmarkBarView); |
| 440 }; | 440 }; |
| 441 | 441 |
| 442 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_ | 442 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_ |
| OLD | NEW |