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

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

Issue 8863009: Fix alignment of avatar bubbles in the NTP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/string16.h" 7 #include "base/string16.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 const BookmarkNode* node = model->GetMostRecentlyAddedNodeForURL(url_); 110 const BookmarkNode* node = model->GetMostRecentlyAddedNodeForURL(url_);
111 if (node) 111 if (node)
112 model->Remove(node->parent(), node->parent()->GetIndexOf(node)); 112 model->Remove(node->parent(), node->parent()->GetIndexOf(node));
113 } 113 }
114 } 114 }
115 115
116 views::View* BookmarkBubbleView::GetInitiallyFocusedView() { 116 views::View* BookmarkBubbleView::GetInitiallyFocusedView() {
117 return title_tf_; 117 return title_tf_;
118 } 118 }
119 119
120 gfx::Point BookmarkBubbleView::GetAnchorPoint() { 120 gfx::Rect BookmarkBubbleView::GetAnchorRect() {
121 // Compensate for some built-in padding in the star image. 121 // Compensate for some built-in padding in the star image.
122 return BubbleDelegateView::GetAnchorPoint().Subtract(gfx::Point(0, 5)); 122 gfx::Rect rect(BubbleDelegateView::GetAnchorRect());
123 rect.Offset(0, -5);
124 return rect;
123 } 125 }
124 126
125 void BookmarkBubbleView::WindowClosing() { 127 void BookmarkBubbleView::WindowClosing() {
126 // We have to reset |bubble_| here, not in our destructor, because we'll be 128 // We have to reset |bubble_| here, not in our destructor, because we'll be
127 // destroyed asynchronously and the shown state will be checked before then. 129 // destroyed asynchronously and the shown state will be checked before then.
128 DCHECK(bookmark_bubble_ == this); 130 DCHECK(bookmark_bubble_ == this);
129 bookmark_bubble_ = NULL; 131 bookmark_bubble_ = NULL;
130 132
131 content::NotificationService::current()->Notify( 133 content::NotificationService::current()->Notify(
132 chrome::NOTIFICATION_BOOKMARK_BUBBLE_HIDDEN, 134 chrome::NOTIFICATION_BOOKMARK_BUBBLE_HIDDEN,
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 const BookmarkNode* new_parent = 332 const BookmarkNode* new_parent =
331 parent_model_.GetNodeAt(parent_combobox_->selected_item()); 333 parent_model_.GetNodeAt(parent_combobox_->selected_item());
332 if (new_parent != node->parent()) { 334 if (new_parent != node->parent()) {
333 UserMetrics::RecordAction( 335 UserMetrics::RecordAction(
334 UserMetricsAction("BookmarkBubble_ChangeParent")); 336 UserMetricsAction("BookmarkBubble_ChangeParent"));
335 model->Move(node, new_parent, new_parent->child_count()); 337 model->Move(node, new_parent, new_parent->child_count());
336 } 338 }
337 } 339 }
338 } 340 }
339 } 341 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h ('k') | chrome/browser/ui/views/confirm_bubble_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698