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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc

Issue 2351593002: [MacViews] Anchor Bookmarks bubble to top-right corner. (Closed)
Patch Set: Addressed review comment Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 std::unique_ptr<BubbleSyncPromoDelegate> delegate, 73 std::unique_ptr<BubbleSyncPromoDelegate> delegate,
74 Profile* profile, 74 Profile* profile,
75 const GURL& url, 75 const GURL& url,
76 bool already_bookmarked) { 76 bool already_bookmarked) {
77 if (bookmark_bubble_) 77 if (bookmark_bubble_)
78 return nullptr; 78 return nullptr;
79 79
80 bookmark_bubble_ = 80 bookmark_bubble_ =
81 new BookmarkBubbleView(anchor_view, observer, std::move(delegate), 81 new BookmarkBubbleView(anchor_view, observer, std::move(delegate),
82 profile, url, !already_bookmarked); 82 profile, url, !already_bookmarked);
83 // Bookmark bubble should always anchor TOP_RIGHT, but the
sky 2016/09/20 02:50:21 If the bookmark bubble should always anchor like y
Eugene But (OOO till 7-30) 2016/09/20 03:11:23 That would feel inconsistent with the code below (
84 // LocationBarBubbleDelegateView does not know that and may use different
85 // arrow anchoring.
86 bookmark_bubble_->set_arrow(views::BubbleBorder::TOP_RIGHT);
83 if (!anchor_view) { 87 if (!anchor_view) {
84 bookmark_bubble_->SetAnchorRect(anchor_rect); 88 bookmark_bubble_->SetAnchorRect(anchor_rect);
85 bookmark_bubble_->set_parent_window(parent_window); 89 bookmark_bubble_->set_parent_window(parent_window);
86 } 90 }
87 views::Widget* bubble_widget = 91 views::Widget* bubble_widget =
88 views::BubbleDialogDelegateView::CreateBubble(bookmark_bubble_); 92 views::BubbleDialogDelegateView::CreateBubble(bookmark_bubble_);
89 bubble_widget->Show(); 93 bubble_widget->Show();
90 // Select the entire title textfield contents when the bubble is first shown. 94 // Select the entire title textfield contents when the bubble is first shown.
91 bookmark_bubble_->title_tf_->SelectAll(true); 95 bookmark_bubble_->title_tf_->SelectAll(true);
92 bookmark_bubble_->SetArrowPaintType(views::BubbleBorder::PAINT_TRANSPARENT); 96 bookmark_bubble_->SetArrowPaintType(views::BubbleBorder::PAINT_TRANSPARENT);
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 if (node) { 346 if (node) {
343 const base::string16 new_title = title_tf_->text(); 347 const base::string16 new_title = title_tf_->text();
344 if (new_title != node->GetTitle()) { 348 if (new_title != node->GetTitle()) {
345 model->SetTitle(node, new_title); 349 model->SetTitle(node, new_title);
346 content::RecordAction( 350 content::RecordAction(
347 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); 351 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble"));
348 } 352 }
349 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); 353 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index());
350 } 354 }
351 } 355 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698