| 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 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 } | 39 } |
| 40 | 40 |
| 41 namespace gfx { | 41 namespace gfx { |
| 42 class SlideAnimation; | 42 class SlideAnimation; |
| 43 } | 43 } |
| 44 | 44 |
| 45 namespace views { | 45 namespace views { |
| 46 class CustomButton; | 46 class CustomButton; |
| 47 class MenuButton; | 47 class MenuButton; |
| 48 class MenuItemView; | 48 class MenuItemView; |
| 49 class TextButton; | 49 class LabelButton; |
| 50 } | 50 } |
| 51 | 51 |
| 52 // BookmarkBarView renders the BookmarkModel. Each starred entry on the | 52 // BookmarkBarView renders the BookmarkModel. Each starred entry on the |
| 53 // BookmarkBar is rendered as a MenuButton. An additional MenuButton aligned to | 53 // BookmarkBar is rendered as a MenuButton. An additional MenuButton aligned to |
| 54 // the right allows the user to quickly see recently starred entries. | 54 // the right allows the user to quickly see recently starred entries. |
| 55 // | 55 // |
| 56 // BookmarkBarView shows the bookmarks from a specific Profile. BookmarkBarView | 56 // BookmarkBarView shows the bookmarks from a specific Profile. BookmarkBarView |
| 57 // waits until the HistoryService for the profile has been loaded before | 57 // waits until the HistoryService for the profile has been loaded before |
| 58 // creating the BookmarkModel. | 58 // creating the BookmarkModel. |
| 59 class BookmarkBarView : public DetachableToolbarView, | 59 class BookmarkBarView : public DetachableToolbarView, |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 // | 284 // |
| 285 // It's easy to get the mapping wrong. For this reason all these methods are | 285 // It's easy to get the mapping wrong. For this reason all these methods are |
| 286 // private. | 286 // private. |
| 287 | 287 |
| 288 // Returns the number of buttons corresponding to starred urls/folders. This | 288 // Returns the number of buttons corresponding to starred urls/folders. This |
| 289 // is equivalent to the number of children the bookmark bar node from the | 289 // is equivalent to the number of children the bookmark bar node from the |
| 290 // bookmark bar model has. | 290 // bookmark bar model has. |
| 291 int GetBookmarkButtonCount() const; | 291 int GetBookmarkButtonCount() const; |
| 292 | 292 |
| 293 // Returns the button at the specified index. | 293 // Returns the button at the specified index. |
| 294 views::TextButton* GetBookmarkButton(int index); | 294 views::LabelButton* GetBookmarkButton(int index); |
| 295 | 295 |
| 296 // Returns BOOKMARK_LAUNCH_LOCATION_DETACHED_BAR or | 296 // Returns BOOKMARK_LAUNCH_LOCATION_DETACHED_BAR or |
| 297 // BOOKMARK_LAUNCH_LOCATION_ATTACHED_BAR based on detached state. | 297 // BOOKMARK_LAUNCH_LOCATION_ATTACHED_BAR based on detached state. |
| 298 BookmarkLaunchLocation GetBookmarkLaunchLocation() const; | 298 BookmarkLaunchLocation GetBookmarkLaunchLocation() const; |
| 299 | 299 |
| 300 // Returns the index of the first hidden bookmark button. If all buttons are | 300 // Returns the index of the first hidden bookmark button. If all buttons are |
| 301 // visible, this returns GetBookmarkButtonCount(). | 301 // visible, this returns GetBookmarkButtonCount(). |
| 302 int GetFirstHiddenNodeIndex(); | 302 int GetFirstHiddenNodeIndex(); |
| 303 | 303 |
| 304 // Creates the button showing the other bookmarked items. | 304 // Creates the button showing the other bookmarked items. |
| 305 views::MenuButton* CreateOtherBookmarkedButton(); | 305 views::MenuButton* CreateOtherBookmarkedButton(); |
| 306 | 306 |
| 307 // Creates the button showing the managed bookmarks items. | 307 // Creates the button showing the managed bookmarks items. |
| 308 views::MenuButton* CreateManagedBookmarksButton(); | 308 views::MenuButton* CreateManagedBookmarksButton(); |
| 309 | 309 |
| 310 // Creates the button used when not all bookmark buttons fit. | 310 // Creates the button used when not all bookmark buttons fit. |
| 311 views::MenuButton* CreateOverflowButton(); | 311 views::MenuButton* CreateOverflowButton(); |
| 312 | 312 |
| 313 // Creates the button for rendering the specified bookmark node. | 313 // Creates the button for rendering the specified bookmark node. |
| 314 views::View* CreateBookmarkButton(const BookmarkNode* node); | 314 views::View* CreateBookmarkButton(const BookmarkNode* node); |
| 315 | 315 |
| 316 // Creates the button for rendering the apps page shortcut. | 316 // Creates the button for rendering the apps page shortcut. |
| 317 views::TextButton* CreateAppsPageShortcutButton(); | 317 views::LabelButton* CreateAppsPageShortcutButton(); |
| 318 | 318 |
| 319 // Configures the button from the specified node. This sets the text, | 319 // Configures the button from the specified node. This sets the text, |
| 320 // and icon. | 320 // and icon. |
| 321 void ConfigureButton(const BookmarkNode* node, views::TextButton* button); | 321 void ConfigureButton(const BookmarkNode* node, views::LabelButton* button); |
| 322 | 322 |
| 323 // Implementation for BookmarkNodeAddedImpl. | 323 // Implementation for BookmarkNodeAddedImpl. |
| 324 void BookmarkNodeAddedImpl(BookmarkModel* model, | 324 void BookmarkNodeAddedImpl(BookmarkModel* model, |
| 325 const BookmarkNode* parent, | 325 const BookmarkNode* parent, |
| 326 int index); | 326 int index); |
| 327 | 327 |
| 328 // Implementation for BookmarkNodeRemoved. | 328 // Implementation for BookmarkNodeRemoved. |
| 329 void BookmarkNodeRemovedImpl(BookmarkModel* model, | 329 void BookmarkNodeRemovedImpl(BookmarkModel* model, |
| 330 const BookmarkNode* parent, | 330 const BookmarkNode* parent, |
| 331 int index); | 331 int index); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 // bookmark bar. | 404 // bookmark bar. |
| 405 scoped_ptr<BookmarkContextMenu> context_menu_; | 405 scoped_ptr<BookmarkContextMenu> context_menu_; |
| 406 | 406 |
| 407 // Shows the other bookmark entries. | 407 // Shows the other bookmark entries. |
| 408 views::MenuButton* other_bookmarked_button_; | 408 views::MenuButton* other_bookmarked_button_; |
| 409 | 409 |
| 410 // Shows the managed bookmarks entries. | 410 // Shows the managed bookmarks entries. |
| 411 views::MenuButton* managed_bookmarks_button_; | 411 views::MenuButton* managed_bookmarks_button_; |
| 412 | 412 |
| 413 // Shows the Apps page shortcut. | 413 // Shows the Apps page shortcut. |
| 414 views::TextButton* apps_page_shortcut_; | 414 views::LabelButton* apps_page_shortcut_; |
| 415 | 415 |
| 416 // Task used to delay showing of the drop menu. | 416 // Task used to delay showing of the drop menu. |
| 417 base::WeakPtrFactory<BookmarkBarView> show_folder_method_factory_; | 417 base::WeakPtrFactory<BookmarkBarView> show_folder_method_factory_; |
| 418 | 418 |
| 419 // Used to track drops on the bookmark bar view. | 419 // Used to track drops on the bookmark bar view. |
| 420 scoped_ptr<DropInfo> drop_info_; | 420 scoped_ptr<DropInfo> drop_info_; |
| 421 | 421 |
| 422 // Visible if not all the bookmark buttons fit. | 422 // Visible if not all the bookmark buttons fit. |
| 423 views::MenuButton* overflow_button_; | 423 views::MenuButton* overflow_button_; |
| 424 | 424 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 444 | 444 |
| 445 BookmarkBar::State bookmark_bar_state_; | 445 BookmarkBar::State bookmark_bar_state_; |
| 446 | 446 |
| 447 // Are we animating to or from the detached state? | 447 // Are we animating to or from the detached state? |
| 448 bool animating_detached_; | 448 bool animating_detached_; |
| 449 | 449 |
| 450 DISALLOW_COPY_AND_ASSIGN(BookmarkBarView); | 450 DISALLOW_COPY_AND_ASSIGN(BookmarkBarView); |
| 451 }; | 451 }; |
| 452 | 452 |
| 453 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_ | 453 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_ |
| OLD | NEW |