| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 const GURL& url, | 80 const GURL& url, |
| 81 bool newly_bookmarked) { | 81 bool newly_bookmarked) { |
| 82 if (IsShowing()) | 82 if (IsShowing()) |
| 83 return; | 83 return; |
| 84 | 84 |
| 85 bookmark_bubble_ = | 85 bookmark_bubble_ = |
| 86 new BookmarkBubbleView(anchor_view, profile, url, newly_bookmarked); | 86 new BookmarkBubbleView(anchor_view, profile, url, newly_bookmarked); |
| 87 views::BubbleDelegateView::CreateBubble(bookmark_bubble_); | 87 views::BubbleDelegateView::CreateBubble(bookmark_bubble_); |
| 88 bookmark_bubble_->Show(); | 88 bookmark_bubble_->Show(); |
| 89 // Select the entire title textfield contents when the bubble is first shown. | 89 // Select the entire title textfield contents when the bubble is first shown. |
| 90 bookmark_bubble_->title_tf_->SelectAll(); | 90 bookmark_bubble_->title_tf_->SelectAll(true); |
| 91 | 91 |
| 92 GURL url_ptr(url); | 92 GURL url_ptr(url); |
| 93 content::NotificationService::current()->Notify( | 93 content::NotificationService::current()->Notify( |
| 94 chrome::NOTIFICATION_BOOKMARK_BUBBLE_SHOWN, | 94 chrome::NOTIFICATION_BOOKMARK_BUBBLE_SHOWN, |
| 95 content::Source<Profile>(profile->GetOriginalProfile()), | 95 content::Source<Profile>(profile->GetOriginalProfile()), |
| 96 content::Details<GURL>(&url_ptr)); | 96 content::Details<GURL>(&url_ptr)); |
| 97 } | 97 } |
| 98 | 98 |
| 99 // static | 99 // static |
| 100 bool BookmarkBubbleView::IsShowing() { | 100 bool BookmarkBubbleView::IsShowing() { |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 const BookmarkNode* new_parent = | 352 const BookmarkNode* new_parent = |
| 353 parent_model_.GetNodeAt(parent_combobox_->selected_index()); | 353 parent_model_.GetNodeAt(parent_combobox_->selected_index()); |
| 354 if (new_parent != node->parent()) { | 354 if (new_parent != node->parent()) { |
| 355 content::RecordAction( | 355 content::RecordAction( |
| 356 UserMetricsAction("BookmarkBubble_ChangeParent")); | 356 UserMetricsAction("BookmarkBubble_ChangeParent")); |
| 357 model->Move(node, new_parent, new_parent->child_count()); | 357 model->Move(node, new_parent, new_parent->child_count()); |
| 358 } | 358 } |
| 359 } | 359 } |
| 360 } | 360 } |
| 361 } | 361 } |
| OLD | NEW |