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 |
(...skipping 27 matching lines...) Expand all Loading... |
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 MenuItemView; |
48 class TextButton; | 48 class LabelButton; |
49 } | 49 } |
50 | 50 |
51 // BookmarkBarView renders the BookmarkModel. Each starred entry on the | 51 // BookmarkBarView renders the BookmarkModel. Each starred entry on the |
52 // BookmarkBar is rendered as a MenuButton. An additional MenuButton aligned to | 52 // BookmarkBar is rendered as a MenuButton. An additional MenuButton aligned to |
53 // the right allows the user to quickly see recently starred entries. | 53 // the right allows the user to quickly see recently starred entries. |
54 // | 54 // |
55 // BookmarkBarView shows the bookmarks from a specific Profile. BookmarkBarView | 55 // BookmarkBarView shows the bookmarks from a specific Profile. BookmarkBarView |
56 // waits until the HistoryService for the profile has been loaded before | 56 // waits until the HistoryService for the profile has been loaded before |
57 // creating the BookmarkModel. | 57 // creating the BookmarkModel. |
58 class BookmarkBarView : public DetachableToolbarView, | 58 class BookmarkBarView : public DetachableToolbarView, |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 // | 281 // |
282 // It's easy to get the mapping wrong. For this reason all these methods are | 282 // It's easy to get the mapping wrong. For this reason all these methods are |
283 // private. | 283 // private. |
284 | 284 |
285 // Returns the number of buttons corresponding to starred urls/folders. This | 285 // Returns the number of buttons corresponding to starred urls/folders. This |
286 // is equivalent to the number of children the bookmark bar node from the | 286 // is equivalent to the number of children the bookmark bar node from the |
287 // bookmark bar model has. | 287 // bookmark bar model has. |
288 int GetBookmarkButtonCount() const; | 288 int GetBookmarkButtonCount() const; |
289 | 289 |
290 // Returns the button at the specified index. | 290 // Returns the button at the specified index. |
291 views::TextButton* GetBookmarkButton(int index); | 291 views::LabelButton* GetBookmarkButton(int index); |
292 | 292 |
293 // Returns BOOKMARK_LAUNCH_LOCATION_DETACHED_BAR or | 293 // Returns BOOKMARK_LAUNCH_LOCATION_DETACHED_BAR or |
294 // BOOKMARK_LAUNCH_LOCATION_ATTACHED_BAR based on detached state. | 294 // BOOKMARK_LAUNCH_LOCATION_ATTACHED_BAR based on detached state. |
295 BookmarkLaunchLocation GetBookmarkLaunchLocation() const; | 295 BookmarkLaunchLocation GetBookmarkLaunchLocation() const; |
296 | 296 |
297 // Returns the index of the first hidden bookmark button. If all buttons are | 297 // Returns the index of the first hidden bookmark button. If all buttons are |
298 // visible, this returns GetBookmarkButtonCount(). | 298 // visible, this returns GetBookmarkButtonCount(). |
299 int GetFirstHiddenNodeIndex(); | 299 int GetFirstHiddenNodeIndex(); |
300 | 300 |
301 // Creates the button showing the other bookmarked items. | 301 // Creates the button showing the other bookmarked items. |
302 views::MenuButton* CreateOtherBookmarkedButton(); | 302 views::MenuButton* CreateOtherBookmarkedButton(); |
303 | 303 |
304 // Creates the button used when not all bookmark buttons fit. | 304 // Creates the button used when not all bookmark buttons fit. |
305 views::MenuButton* CreateOverflowButton(); | 305 views::MenuButton* CreateOverflowButton(); |
306 | 306 |
307 // Creates the button for rendering the specified bookmark node. | 307 // Creates the button for rendering the specified bookmark node. |
308 views::View* CreateBookmarkButton(const BookmarkNode* node); | 308 views::View* CreateBookmarkButton(const BookmarkNode* node); |
309 | 309 |
310 // Creates the button for rendering the apps page shortcut. | 310 // Creates the button for rendering the apps page shortcut. |
311 views::TextButton* CreateAppsPageShortcutButton(); | 311 views::LabelButton* CreateAppsPageShortcutButton(); |
312 | 312 |
313 // Configures the button from the specified node. This sets the text, | 313 // Configures the button from the specified node. This sets the text, |
314 // and icon. | 314 // and icon. |
315 void ConfigureButton(const BookmarkNode* node, views::TextButton* button); | 315 void ConfigureButton(const BookmarkNode* node, views::LabelButton* button); |
316 | 316 |
317 // Implementation for BookmarkNodeAddedImpl. | 317 // Implementation for BookmarkNodeAddedImpl. |
318 void BookmarkNodeAddedImpl(BookmarkModel* model, | 318 void BookmarkNodeAddedImpl(BookmarkModel* model, |
319 const BookmarkNode* parent, | 319 const BookmarkNode* parent, |
320 int index); | 320 int index); |
321 | 321 |
322 // Implementation for BookmarkNodeRemoved. | 322 // Implementation for BookmarkNodeRemoved. |
323 void BookmarkNodeRemovedImpl(BookmarkModel* model, | 323 void BookmarkNodeRemovedImpl(BookmarkModel* model, |
324 const BookmarkNode* parent, | 324 const BookmarkNode* parent, |
325 int index); | 325 int index); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 BookmarkMenuController* bookmark_drop_menu_; | 395 BookmarkMenuController* bookmark_drop_menu_; |
396 | 396 |
397 // If non-NULL we're showing a context menu for one of the items on the | 397 // If non-NULL we're showing a context menu for one of the items on the |
398 // bookmark bar. | 398 // bookmark bar. |
399 scoped_ptr<BookmarkContextMenu> context_menu_; | 399 scoped_ptr<BookmarkContextMenu> context_menu_; |
400 | 400 |
401 // Shows the other bookmark entries. | 401 // Shows the other bookmark entries. |
402 views::MenuButton* other_bookmarked_button_; | 402 views::MenuButton* other_bookmarked_button_; |
403 | 403 |
404 // Shows the Apps page shortcut. | 404 // Shows the Apps page shortcut. |
405 views::TextButton* apps_page_shortcut_; | 405 views::LabelButton* apps_page_shortcut_; |
406 | 406 |
407 // Task used to delay showing of the drop menu. | 407 // Task used to delay showing of the drop menu. |
408 base::WeakPtrFactory<BookmarkBarView> show_folder_method_factory_; | 408 base::WeakPtrFactory<BookmarkBarView> show_folder_method_factory_; |
409 | 409 |
410 // Used to track drops on the bookmark bar view. | 410 // Used to track drops on the bookmark bar view. |
411 scoped_ptr<DropInfo> drop_info_; | 411 scoped_ptr<DropInfo> drop_info_; |
412 | 412 |
413 // Visible if not all the bookmark buttons fit. | 413 // Visible if not all the bookmark buttons fit. |
414 views::MenuButton* overflow_button_; | 414 views::MenuButton* overflow_button_; |
415 | 415 |
(...skipping 19 matching lines...) Expand all Loading... |
435 | 435 |
436 BookmarkBar::State bookmark_bar_state_; | 436 BookmarkBar::State bookmark_bar_state_; |
437 | 437 |
438 // Are we animating to or from the detached state? | 438 // Are we animating to or from the detached state? |
439 bool animating_detached_; | 439 bool animating_detached_; |
440 | 440 |
441 DISALLOW_COPY_AND_ASSIGN(BookmarkBarView); | 441 DISALLOW_COPY_AND_ASSIGN(BookmarkBarView); |
442 }; | 442 }; |
443 | 443 |
444 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_ | 444 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_ |
OLD | NEW |