| Index: chrome/browser/ui/views/toolbar/browser_actions_container.h
|
| diff --git a/chrome/browser/ui/views/toolbar/browser_actions_container.h b/chrome/browser/ui/views/toolbar/browser_actions_container.h
|
| index da220d2964acc1c3bc0a787b5da902dcab9683b4..919c3643afc60c0c6049a5c3e6171bd263eff077 100644
|
| --- a/chrome/browser/ui/views/toolbar/browser_actions_container.h
|
| +++ b/chrome/browser/ui/views/toolbar/browser_actions_container.h
|
| @@ -13,7 +13,6 @@
|
| #include "base/observer_list.h"
|
| #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h"
|
| #include "chrome/browser/ui/toolbar/toolbar_actions_bar_delegate.h"
|
| -#include "chrome/browser/ui/views/toolbar/chevron_menu_button.h"
|
| #include "chrome/browser/ui/views/toolbar/toolbar_action_view.h"
|
| #include "ui/gfx/animation/animation_delegate.h"
|
| #include "ui/gfx/animation/slide_animation.h"
|
| @@ -53,7 +52,7 @@ class ResizeArea;
|
| // The main container is placed flush against the omnibox and hot dog menu,
|
| // whereas the overflow container is placed within the hot dog menu. The
|
| // layout is similar to this:
|
| -// rI_I_IcCs
|
| +// rI_I_Is
|
| // Where the letters are as follows:
|
| // r: An invisible resize area. This is
|
| // GetLayoutConstant(TOOLBAR_STANDARD_SPACING) pixels wide and directly
|
| @@ -61,19 +60,13 @@ class ResizeArea;
|
| // I: An icon. In material design this has a width of 28. Otherwise it is as
|
| // wide as the IDR_BROWSER_ACTION image.
|
| // _: ToolbarActionsBar::PlatformSettings::item_spacing pixels of empty space.
|
| -// c: GetChevronSpacing() pixels of empty space. Only present if C is present.
|
| -// C: An optional chevron, as wide as the IDR_BROWSER_ACTIONS_OVERFLOW image,
|
| -// and visible only when both of the following statements are true:
|
| -// - The container is set to a width smaller than needed to show all icons.
|
| -// - There is no other container in 'overflow' mode to handle the
|
| -// non-visible icons for this container.
|
| // s: GetLayoutConstant(TOOLBAR_STANDARD_SPACING) pixels of empty space
|
| // (before the app menu).
|
| // The reason the container contains the trailing space "s", rather than having
|
| -// it be handled by the parent view, is so that when the chevron is invisible
|
| -// and the user starts dragging an icon around, we have the space to draw the
|
| -// ultimate drop indicator. (Otherwise, we'd be trying to draw it into the
|
| -// padding beyond our right edge, and it wouldn't appear.)
|
| +// it be handled by the parent view, is so that when the user starts
|
| +// dragging an icon around, we have the space to draw the ultimate drop
|
| +// indicator. (Otherwise, we'd be trying to draw it into the padding beyond our
|
| +// right edge, and it wouldn't appear.)
|
| //
|
| // The BrowserActionsContainer in 'main' mode follows a few rules, in terms of
|
| // user experience:
|
| @@ -81,8 +74,8 @@ class ResizeArea;
|
| // 1) The container can never grow beyond the space needed to show all icons
|
| // (hereby referred to as the max width).
|
| // 2) The container can never shrink below the space needed to show just the
|
| -// initial padding and the chevron (ignoring the case where there are no icons
|
| -// to show, in which case the container won't be visible anyway).
|
| +// initial padding (ignoring the case where there are no icons to show, in which
|
| +// case the container won't be visible anyway).
|
| // 3) The container snaps into place (to the pixel count that fits the visible
|
| // icons) to make sure there is no wasted space at the edges of the container.
|
| // 4) If the user adds or removes icons (read: installs/uninstalls browser
|
| @@ -91,8 +84,7 @@ class ResizeArea;
|
| // 5) If the container is NOT at max width (has an overflow menu), we respect
|
| // that size when adding and removing icons and DON'T grow/shrink the container.
|
| // This means that new icons (which always appear at the far right) will show up
|
| -// in the overflow. The install bubble for extensions points to the chevron
|
| -// menu in this case.
|
| +// in the overflow.
|
| //
|
| // Resizing the BrowserActionsContainer:
|
| //
|
| @@ -117,12 +109,6 @@ class ResizeArea;
|
| // size (animation_target_size_), using |resize_amount| to keep track of the
|
| // animation progress.
|
| //
|
| -// NOTE: When adding Browser Actions to a maximum width container (no overflow)
|
| -// we make sure to suppress the chevron menu if it wasn't visible. This is
|
| -// because we won't have enough space to show the new Browser Action until the
|
| -// animation ends and we don't want the chevron to flash into view while we are
|
| -// growing the container.
|
| -//
|
| ////////////////////////////////////////////////////////////////////////////////
|
| class BrowserActionsContainer : public views::View,
|
| public ToolbarActionsBarDelegate,
|
| @@ -137,15 +123,9 @@ class BrowserActionsContainer : public views::View,
|
| BrowserActionsContainer* main_container);
|
| ~BrowserActionsContainer() override;
|
|
|
| - void Init();
|
| -
|
| // Get the number of toolbar actions being displayed.
|
| size_t num_toolbar_actions() const { return toolbar_action_views_.size(); }
|
|
|
| - // Returns the chevron, if any.
|
| - views::View* chevron() { return chevron_; }
|
| - const views::View* chevron() const { return chevron_; }
|
| -
|
| // Returns the browser this container is associated with.
|
| Browser* browser() const { return browser_; }
|
|
|
| @@ -248,14 +228,11 @@ class BrowserActionsContainer : public views::View,
|
|
|
| views::BubbleDialogDelegateView* active_bubble() { return active_bubble_; }
|
|
|
| - ChevronMenuButton* chevron_for_testing() { return chevron_; }
|
| -
|
| protected:
|
| // Overridden from views::View:
|
| void ViewHierarchyChanged(
|
| const ViewHierarchyChangedDetails& details) override;
|
| void OnPaint(gfx::Canvas* canvas) override;
|
| - void OnThemeChanged() override;
|
|
|
| private:
|
| // A struct representing the position at which an action will be dropped.
|
| @@ -263,8 +240,6 @@ class BrowserActionsContainer : public views::View,
|
|
|
| typedef std::vector<ToolbarActionView*> ToolbarActionViews;
|
|
|
| - void LoadImages();
|
| -
|
| // Clears the |active_bubble_|, and unregisters the container as an observer.
|
| void ClearActiveBubble(views::Widget* widget);
|
|
|
| @@ -272,10 +247,6 @@ class BrowserActionsContainer : public views::View,
|
| return toolbar_actions_bar_->platform_settings();
|
| }
|
|
|
| - // Whether this container is in overflow mode (as opposed to in 'main'
|
| - // mode). See class comments for details on the difference.
|
| - bool in_overflow_mode() const { return main_container_ != NULL; }
|
| -
|
| // The controlling ToolbarActionsBar, which handles most non-view logic.
|
| std::unique_ptr<ToolbarActionsBar> toolbar_actions_bar_;
|
|
|
| @@ -293,10 +264,6 @@ class BrowserActionsContainer : public views::View,
|
| // The resize area for the container.
|
| views::ResizeArea* resize_area_;
|
|
|
| - // The chevron for accessing the overflow items. Can be NULL when in overflow
|
| - // mode or if the toolbar is permanently suppressing the chevron menu.
|
| - ChevronMenuButton* chevron_;
|
| -
|
| // The painter used when we are highlighting a subset of extensions.
|
| std::unique_ptr<views::Painter> info_highlight_painter_;
|
| std::unique_ptr<views::Painter> warning_highlight_painter_;
|
| @@ -304,9 +271,6 @@ class BrowserActionsContainer : public views::View,
|
| // The animation that happens when the container snaps to place.
|
| std::unique_ptr<gfx::SlideAnimation> resize_animation_;
|
|
|
| - // Don't show the chevron while animating.
|
| - bool suppress_chevron_;
|
| -
|
| // True if the container has been added to the parent view.
|
| bool added_to_view_;
|
|
|
|
|