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" |
11 #include "chrome/browser/bookmarks/bookmark_editor.h" | 11 #include "chrome/browser/bookmarks/bookmark_editor.h" |
12 #include "chrome/browser/bookmarks/bookmark_model.h" | 12 #include "chrome/browser/bookmarks/bookmark_model.h" |
13 #include "chrome/browser/bookmarks/bookmark_utils.h" | 13 #include "chrome/browser/bookmarks/bookmark_utils.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
16 #include "chrome/browser/ui/browser_list.h" | 16 #include "chrome/browser/ui/browser_list.h" |
| 17 #include "chrome/browser/ui/views/window.h" |
17 #include "chrome/common/chrome_notification_types.h" | 18 #include "chrome/common/chrome_notification_types.h" |
18 #include "content/browser/user_metrics.h" | 19 #include "content/browser/user_metrics.h" |
19 #include "content/public/browser/notification_service.h" | 20 #include "content/public/browser/notification_service.h" |
20 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
21 #include "grit/theme_resources.h" | 22 #include "grit/theme_resources.h" |
22 #include "ui/base/keycodes/keyboard_codes.h" | 23 #include "ui/base/keycodes/keyboard_codes.h" |
23 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
24 #include "ui/base/resource/resource_bundle.h" | 25 #include "ui/base/resource/resource_bundle.h" |
25 #include "ui/views/events/event.h" | 26 #include "ui/views/events/event.h" |
26 #include "ui/views/layout/grid_layout.h" | 27 #include "ui/views/layout/grid_layout.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // static | 76 // static |
76 void BookmarkBubbleView::ShowBubble(views::View* anchor_view, | 77 void BookmarkBubbleView::ShowBubble(views::View* anchor_view, |
77 Profile* profile, | 78 Profile* profile, |
78 const GURL& url, | 79 const GURL& url, |
79 bool newly_bookmarked) { | 80 bool newly_bookmarked) { |
80 if (IsShowing()) | 81 if (IsShowing()) |
81 return; | 82 return; |
82 | 83 |
83 bookmark_bubble_ = | 84 bookmark_bubble_ = |
84 new BookmarkBubbleView(anchor_view, profile, url, newly_bookmarked); | 85 new BookmarkBubbleView(anchor_view, profile, url, newly_bookmarked); |
85 views::BubbleDelegateView::CreateBubble(bookmark_bubble_); | 86 browser::CreateViewsBubble(bookmark_bubble_); |
86 bookmark_bubble_->Show(); | 87 bookmark_bubble_->Show(); |
87 // Select the entire title textfield contents when the bubble is first shown. | 88 // Select the entire title textfield contents when the bubble is first shown. |
88 bookmark_bubble_->title_tf_->SelectAll(); | 89 bookmark_bubble_->title_tf_->SelectAll(); |
89 | 90 |
90 GURL url_ptr(url); | 91 GURL url_ptr(url); |
91 content::NotificationService::current()->Notify( | 92 content::NotificationService::current()->Notify( |
92 chrome::NOTIFICATION_BOOKMARK_BUBBLE_SHOWN, | 93 chrome::NOTIFICATION_BOOKMARK_BUBBLE_SHOWN, |
93 content::Source<Profile>(profile->GetOriginalProfile()), | 94 content::Source<Profile>(profile->GetOriginalProfile()), |
94 content::Details<GURL>(&url_ptr)); | 95 content::Details<GURL>(&url_ptr)); |
95 } | 96 } |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 const BookmarkNode* new_parent = | 333 const BookmarkNode* new_parent = |
333 parent_model_.GetNodeAt(parent_combobox_->selected_item()); | 334 parent_model_.GetNodeAt(parent_combobox_->selected_item()); |
334 if (new_parent != node->parent()) { | 335 if (new_parent != node->parent()) { |
335 UserMetrics::RecordAction( | 336 UserMetrics::RecordAction( |
336 UserMetricsAction("BookmarkBubble_ChangeParent")); | 337 UserMetricsAction("BookmarkBubble_ChangeParent")); |
337 model->Move(node, new_parent, new_parent->child_count()); | 338 model->Move(node, new_parent, new_parent->child_count()); |
338 } | 339 } |
339 } | 340 } |
340 } | 341 } |
341 } | 342 } |
OLD | NEW |