Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1954)

Unified Diff: chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc

Issue 2630473003: MacViews: Harmony for toolbar actions bubbles. (Closed)
Patch Set: respond to comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc
diff --git a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc
index 662e6d50eb97795e601da10cbf5ed8e2a728a764..6ca61fdc66ef099ccbc96dd9f26b30d0673f9bf1 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc
@@ -5,7 +5,6 @@
#include "chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h"
#include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h"
-#include "chrome/browser/ui/view_ids.h"
#include "chrome/browser/ui/views/harmony/layout_delegate.h"
#include "chrome/grit/locale_settings.h"
#include "ui/base/resource/resource_bundle.h"
@@ -24,13 +23,18 @@ const int kIconSize = 16;
ToolbarActionsBarBubbleViews::ToolbarActionsBarBubbleViews(
views::View* anchor_view,
+ const gfx::Point& anchor_point,
+ bool anchored_to_action,
std::unique_ptr<ToolbarActionsBarBubbleDelegate> delegate)
: views::BubbleDialogDelegateView(anchor_view,
views::BubbleBorder::TOP_RIGHT),
delegate_(std::move(delegate)),
item_list_(nullptr),
- link_(nullptr) {
+ link_(nullptr),
+ anchored_to_action_(anchored_to_action) {
set_close_on_deactivate(delegate_->ShouldCloseOnDeactivate());
+ if (!anchor_view)
+ SetAnchorRect(gfx::Rect(anchor_point, gfx::Size()));
}
ToolbarActionsBarBubbleViews::~ToolbarActionsBarBubbleViews() {}
@@ -113,8 +117,8 @@ void ToolbarActionsBarBubbleViews::Init() {
LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)));
// Add the content string.
- views::Label* content_label = new views::Label(
- delegate_->GetBodyText(GetAnchorView()->id() == VIEW_ID_BROWSER_ACTION));
+ views::Label* content_label =
+ new views::Label(delegate_->GetBodyText(anchored_to_action_));
content_label->SetMultiLine(true);
int width = views::Widget::GetLocalizedContentsWidth(
IDS_EXTENSION_TOOLBAR_REDESIGN_NOTIFICATION_BUBBLE_WIDTH_CHARS);

Powered by Google App Engine
This is Rietveld 408576698