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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 // Returns the index of the first hidden bookmark button. If all buttons are | 299 // Returns the index of the first hidden bookmark button. If all buttons are |
300 // visible, this returns GetBookmarkButtonCount(). | 300 // visible, this returns GetBookmarkButtonCount(). |
301 int GetFirstHiddenNodeIndex(); | 301 int GetFirstHiddenNodeIndex(); |
302 | 302 |
303 // Creates the button showing the "Other Bookmarks" folder. | 303 // Creates the button showing the "Other Bookmarks" folder. |
304 views::MenuButton* CreateOtherBookmarksButton(); | 304 views::MenuButton* CreateOtherBookmarksButton(); |
305 | 305 |
306 // Creates the button showing the "Managed Bookmarks" folder. | 306 // Creates the button showing the "Managed Bookmarks" folder. |
307 views::MenuButton* CreateManagedBookmarksButton(); | 307 views::MenuButton* CreateManagedBookmarksButton(); |
308 | 308 |
| 309 // Creates the button showing the supervised bookmarks items. |
| 310 views::MenuButton* CreateSupervisedBookmarksButton(); |
| 311 |
309 // Creates the button used when not all bookmark buttons fit. | 312 // Creates the button used when not all bookmark buttons fit. |
310 views::MenuButton* CreateOverflowButton(); | 313 views::MenuButton* CreateOverflowButton(); |
311 | 314 |
312 // Creates the button for rendering the specified bookmark node. | 315 // Creates the button for rendering the specified bookmark node. |
313 views::View* CreateBookmarkButton(const bookmarks::BookmarkNode* node); | 316 views::View* CreateBookmarkButton(const bookmarks::BookmarkNode* node); |
314 | 317 |
315 // Creates the button for rendering the apps page shortcut. | 318 // Creates the button for rendering the apps page shortcut. |
316 views::LabelButton* CreateAppsPageShortcutButton(); | 319 views::LabelButton* CreateAppsPageShortcutButton(); |
317 | 320 |
318 // Configures the button from the specified node. This sets the text, | 321 // Configures the button from the specified node. This sets the text, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 // Returns the view to throb when a node is removed. |parent| is the parent of | 367 // Returns the view to throb when a node is removed. |parent| is the parent of |
365 // the node that was removed, and |old_index| the index of the node that was | 368 // the node that was removed, and |old_index| the index of the node that was |
366 // removed. | 369 // removed. |
367 views::CustomButton* DetermineViewToThrobFromRemove( | 370 views::CustomButton* DetermineViewToThrobFromRemove( |
368 const bookmarks::BookmarkNode* parent, | 371 const bookmarks::BookmarkNode* parent, |
369 int old_index); | 372 int old_index); |
370 | 373 |
371 // Updates the colors for all the child objects in the bookmarks bar. | 374 // Updates the colors for all the child objects in the bookmarks bar. |
372 void UpdateColors(); | 375 void UpdateColors(); |
373 | 376 |
374 // Updates the visibility of |other_bookmarks_button_| and | 377 // Updates the visibility of |other_bookmarks_button_|, |
375 // |managed_bookmarks_button_|. Also shows or hides the separator if required. | 378 // |managed_bookmarks_button_|, and |supervised_bookmarks_button_|. Also |
| 379 // shows or hides the separator if required. |
376 // Returns true if something changed and a LayoutAndPaint() is needed. | 380 // Returns true if something changed and a LayoutAndPaint() is needed. |
377 bool UpdateOtherAndManagedButtonsVisibility(); | 381 bool UpdateOtherAndManagedButtonsVisibility(); |
378 | 382 |
379 // Updates the visibility of |bookmarks_separator_view_|. | 383 // Updates the visibility of |bookmarks_separator_view_|. |
380 void UpdateBookmarksSeparatorVisibility(); | 384 void UpdateBookmarksSeparatorVisibility(); |
381 | 385 |
382 // Updates the visibility of the apps shortcut based on the pref value. | 386 // Updates the visibility of the apps shortcut based on the pref value. |
383 void OnAppsPageShortcutVisibilityPrefChanged(); | 387 void OnAppsPageShortcutVisibilityPrefChanged(); |
384 | 388 |
385 void OnShowManagedBookmarksPrefChanged(); | 389 void OnShowManagedBookmarksPrefChanged(); |
(...skipping 28 matching lines...) Expand all Loading... |
414 // If non-NULL we're showing a context menu for one of the items on the | 418 // If non-NULL we're showing a context menu for one of the items on the |
415 // bookmark bar. | 419 // bookmark bar. |
416 scoped_ptr<BookmarkContextMenu> context_menu_; | 420 scoped_ptr<BookmarkContextMenu> context_menu_; |
417 | 421 |
418 // Shows the "Other Bookmarks" folder button. | 422 // Shows the "Other Bookmarks" folder button. |
419 views::MenuButton* other_bookmarks_button_; | 423 views::MenuButton* other_bookmarks_button_; |
420 | 424 |
421 // Shows the managed bookmarks entries. | 425 // Shows the managed bookmarks entries. |
422 views::MenuButton* managed_bookmarks_button_; | 426 views::MenuButton* managed_bookmarks_button_; |
423 | 427 |
| 428 // Shows the supervised bookmarks entries. |
| 429 views::MenuButton* supervised_bookmarks_button_; |
| 430 |
424 // Shows the Apps page shortcut. | 431 // Shows the Apps page shortcut. |
425 views::LabelButton* apps_page_shortcut_; | 432 views::LabelButton* apps_page_shortcut_; |
426 | 433 |
427 // Used to track drops on the bookmark bar view. | 434 // Used to track drops on the bookmark bar view. |
428 scoped_ptr<DropInfo> drop_info_; | 435 scoped_ptr<DropInfo> drop_info_; |
429 | 436 |
430 // Visible if not all the bookmark buttons fit. | 437 // Visible if not all the bookmark buttons fit. |
431 views::MenuButton* overflow_button_; | 438 views::MenuButton* overflow_button_; |
432 | 439 |
433 // Shows a text and a link to import bookmarks if there are no bookmarks in | 440 // Shows a text and a link to import bookmarks if there are no bookmarks in |
(...skipping 23 matching lines...) Expand all Loading... |
457 | 464 |
458 ObserverList<BookmarkBarViewObserver> observers_; | 465 ObserverList<BookmarkBarViewObserver> observers_; |
459 | 466 |
460 // Factory used to delay showing of the drop menu. | 467 // Factory used to delay showing of the drop menu. |
461 base::WeakPtrFactory<BookmarkBarView> show_folder_method_factory_; | 468 base::WeakPtrFactory<BookmarkBarView> show_folder_method_factory_; |
462 | 469 |
463 DISALLOW_COPY_AND_ASSIGN(BookmarkBarView); | 470 DISALLOW_COPY_AND_ASSIGN(BookmarkBarView); |
464 }; | 471 }; |
465 | 472 |
466 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_ | 473 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_ |
OLD | NEW |