OLD | NEW |
---|---|
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 const BookmarkNode* node = model->GetMostRecentlyAddedNodeForURL(url_); | 113 const BookmarkNode* node = model->GetMostRecentlyAddedNodeForURL(url_); |
114 if (node) | 114 if (node) |
115 model->Remove(node->parent(), node->parent()->GetIndexOf(node)); | 115 model->Remove(node->parent(), node->parent()->GetIndexOf(node)); |
116 } | 116 } |
117 } | 117 } |
118 | 118 |
119 views::View* BookmarkBubbleView::GetInitiallyFocusedView() { | 119 views::View* BookmarkBubbleView::GetInitiallyFocusedView() { |
120 return title_tf_; | 120 return title_tf_; |
121 } | 121 } |
122 | 122 |
123 gfx::Point BookmarkBubbleView::GetAnchorPoint() { | 123 gfx::Rect BookmarkBubbleView::GetAnchorRect() { |
124 // Compensate for some built-in padding in the star image. | 124 // Compensate for some built-in padding in the star image. |
125 return BubbleDelegateView::GetAnchorPoint().Subtract(gfx::Point(0, 5)); | 125 gfx::Rect rect(BubbleDelegateView::GetAnchorRect()); |
126 rect.Offset(0, -5); | |
msw
2011/12/08 00:40:14
Please change this to rect.Inset(5, 5); Thanks!
sail
2011/12/08 01:41:10
Unfortunately Inset() doesn't do the right thing s
msw
2011/12/08 06:26:41
Bummer! okay, I'll fix it later.
| |
127 return rect; | |
126 } | 128 } |
127 | 129 |
128 void BookmarkBubbleView::WindowClosing() { | 130 void BookmarkBubbleView::WindowClosing() { |
129 // We have to reset |bubble_| here, not in our destructor, because we'll be | 131 // We have to reset |bubble_| here, not in our destructor, because we'll be |
130 // destroyed asynchronously and the shown state will be checked before then. | 132 // destroyed asynchronously and the shown state will be checked before then. |
131 DCHECK(bookmark_bubble_ == this); | 133 DCHECK(bookmark_bubble_ == this); |
132 bookmark_bubble_ = NULL; | 134 bookmark_bubble_ = NULL; |
133 | 135 |
134 content::NotificationService::current()->Notify( | 136 content::NotificationService::current()->Notify( |
135 chrome::NOTIFICATION_BOOKMARK_BUBBLE_HIDDEN, | 137 chrome::NOTIFICATION_BOOKMARK_BUBBLE_HIDDEN, |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
333 const BookmarkNode* new_parent = | 335 const BookmarkNode* new_parent = |
334 parent_model_.GetNodeAt(parent_combobox_->selected_item()); | 336 parent_model_.GetNodeAt(parent_combobox_->selected_item()); |
335 if (new_parent != node->parent()) { | 337 if (new_parent != node->parent()) { |
336 UserMetrics::RecordAction( | 338 UserMetrics::RecordAction( |
337 UserMetricsAction("BookmarkBubble_ChangeParent")); | 339 UserMetricsAction("BookmarkBubble_ChangeParent")); |
338 model->Move(node, new_parent, new_parent->child_count()); | 340 model->Move(node, new_parent, new_parent->child_count()); |
339 } | 341 } |
340 } | 342 } |
341 } | 343 } |
342 } | 344 } |
OLD | NEW |