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