OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/bookmark_bubble_view.h" | 5 #include "chrome/browser/views/bookmark_bubble_view.h" |
6 | 6 |
7 #include "app/keyboard_codes.h" | 7 #include "app/keyboard_codes.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 const GURL& url, | 85 const GURL& url, |
86 bool newly_bookmarked) { | 86 bool newly_bookmarked) { |
87 if (IsShowing()) | 87 if (IsShowing()) |
88 return; | 88 return; |
89 | 89 |
90 bubble_ = new BookmarkBubbleView(delegate, profile, url, newly_bookmarked); | 90 bubble_ = new BookmarkBubbleView(delegate, profile, url, newly_bookmarked); |
91 InfoBubble* info_bubble = InfoBubble::Show( | 91 InfoBubble* info_bubble = InfoBubble::Show( |
92 parent->GetClientView()->GetWidget(), bounds, BubbleBorder::TOP_RIGHT, | 92 parent->GetClientView()->GetWidget(), bounds, BubbleBorder::TOP_RIGHT, |
93 bubble_, bubble_); | 93 bubble_, bubble_); |
94 bubble_->set_info_bubble(info_bubble); | 94 bubble_->set_info_bubble(info_bubble); |
| 95 info_bubble->SizeToContents(); |
95 GURL url_ptr(url); | 96 GURL url_ptr(url); |
96 NotificationService::current()->Notify( | 97 NotificationService::current()->Notify( |
97 NotificationType::BOOKMARK_BUBBLE_SHOWN, | 98 NotificationType::BOOKMARK_BUBBLE_SHOWN, |
98 Source<Profile>(profile->GetOriginalProfile()), | 99 Source<Profile>(profile->GetOriginalProfile()), |
99 Details<GURL>(&url_ptr)); | 100 Details<GURL>(&url_ptr)); |
100 bubble_->BubbleShown(); | 101 bubble_->BubbleShown(); |
101 } | 102 } |
102 | 103 |
103 // static | 104 // static |
104 bool BookmarkBubbleView::IsShowing() { | 105 bool BookmarkBubbleView::IsShowing() { |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 const BookmarkNode* new_parent = | 405 const BookmarkNode* new_parent = |
405 parent_model_.GetNodeAt(parent_combobox_->selected_item()); | 406 parent_model_.GetNodeAt(parent_combobox_->selected_item()); |
406 if (new_parent != node->GetParent()) { | 407 if (new_parent != node->GetParent()) { |
407 UserMetrics::RecordAction( | 408 UserMetrics::RecordAction( |
408 UserMetricsAction("BookmarkBubble_ChangeParent"), profile_); | 409 UserMetricsAction("BookmarkBubble_ChangeParent"), profile_); |
409 model->Move(node, new_parent, new_parent->GetChildCount()); | 410 model->Move(node, new_parent, new_parent->GetChildCount()); |
410 } | 411 } |
411 } | 412 } |
412 } | 413 } |
413 } | 414 } |
OLD | NEW |