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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 void BookmarkBubbleView::Show(views::Window* parent, | 81 void BookmarkBubbleView::Show(views::Window* parent, |
82 const gfx::Rect& bounds, | 82 const gfx::Rect& bounds, |
83 InfoBubbleDelegate* delegate, | 83 InfoBubbleDelegate* delegate, |
84 Profile* profile, | 84 Profile* profile, |
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 = | 91 InfoBubble* info_bubble = InfoBubble::Show( |
92 InfoBubble::Show(parent->GetClientView()->GetWidget(), bounds, | 92 parent->GetClientView()->GetWidget(), bounds, BubbleBorder::TOP_RIGHT, |
93 BubbleBorder::TOP_RIGHT, bubble_, bubble_); | 93 bubble_, bubble_); |
94 bubble_->set_info_bubble(info_bubble); | 94 bubble_->set_info_bubble(info_bubble); |
95 GURL url_ptr(url); | 95 GURL url_ptr(url); |
96 NotificationService::current()->Notify( | 96 NotificationService::current()->Notify( |
97 NotificationType::BOOKMARK_BUBBLE_SHOWN, | 97 NotificationType::BOOKMARK_BUBBLE_SHOWN, |
98 Source<Profile>(profile->GetOriginalProfile()), | 98 Source<Profile>(profile->GetOriginalProfile()), |
99 Details<GURL>(&url_ptr)); | 99 Details<GURL>(&url_ptr)); |
100 bubble_->BubbleShown(); | 100 bubble_->BubbleShown(); |
101 } | 101 } |
102 | 102 |
103 // static | 103 // static |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 const BookmarkNode* new_parent = | 404 const BookmarkNode* new_parent = |
405 parent_model_.GetNodeAt(parent_combobox_->selected_item()); | 405 parent_model_.GetNodeAt(parent_combobox_->selected_item()); |
406 if (new_parent != node->GetParent()) { | 406 if (new_parent != node->GetParent()) { |
407 UserMetrics::RecordAction( | 407 UserMetrics::RecordAction( |
408 UserMetricsAction("BookmarkBubble_ChangeParent"), profile_); | 408 UserMetricsAction("BookmarkBubble_ChangeParent"), profile_); |
409 model->Move(node, new_parent, new_parent->GetChildCount()); | 409 model->Move(node, new_parent, new_parent->GetChildCount()); |
410 } | 410 } |
411 } | 411 } |
412 } | 412 } |
413 } | 413 } |
OLD | NEW |