Chromium Code Reviews| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 std::unique_ptr<BubbleSyncPromoDelegate> delegate, | 73 std::unique_ptr<BubbleSyncPromoDelegate> delegate, |
| 74 Profile* profile, | 74 Profile* profile, |
| 75 const GURL& url, | 75 const GURL& url, |
| 76 bool already_bookmarked) { | 76 bool already_bookmarked) { |
| 77 if (bookmark_bubble_) | 77 if (bookmark_bubble_) |
| 78 return nullptr; | 78 return nullptr; |
| 79 | 79 |
| 80 bookmark_bubble_ = | 80 bookmark_bubble_ = |
| 81 new BookmarkBubbleView(anchor_view, observer, std::move(delegate), | 81 new BookmarkBubbleView(anchor_view, observer, std::move(delegate), |
| 82 profile, url, !already_bookmarked); | 82 profile, url, !already_bookmarked); |
| 83 bookmark_bubble_->set_arrow(views::BubbleBorder::TOP_RIGHT); | |
|
tapted
2016/09/20 01:37:13
This still needs a comment - e.g. "BookmarkBubble
Eugene But (OOO till 7-30)
2016/09/20 01:57:44
Added a comment. Made it more generic w/o describi
| |
| 83 if (!anchor_view) { | 84 if (!anchor_view) { |
| 84 bookmark_bubble_->SetAnchorRect(anchor_rect); | 85 bookmark_bubble_->SetAnchorRect(anchor_rect); |
| 85 bookmark_bubble_->set_parent_window(parent_window); | 86 bookmark_bubble_->set_parent_window(parent_window); |
| 86 } | 87 } |
| 87 views::Widget* bubble_widget = | 88 views::Widget* bubble_widget = |
| 88 views::BubbleDialogDelegateView::CreateBubble(bookmark_bubble_); | 89 views::BubbleDialogDelegateView::CreateBubble(bookmark_bubble_); |
| 89 bubble_widget->Show(); | 90 bubble_widget->Show(); |
| 90 // Select the entire title textfield contents when the bubble is first shown. | 91 // Select the entire title textfield contents when the bubble is first shown. |
| 91 bookmark_bubble_->title_tf_->SelectAll(true); | 92 bookmark_bubble_->title_tf_->SelectAll(true); |
| 92 bookmark_bubble_->SetArrowPaintType(views::BubbleBorder::PAINT_TRANSPARENT); | 93 bookmark_bubble_->SetArrowPaintType(views::BubbleBorder::PAINT_TRANSPARENT); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 342 if (node) { | 343 if (node) { |
| 343 const base::string16 new_title = title_tf_->text(); | 344 const base::string16 new_title = title_tf_->text(); |
| 344 if (new_title != node->GetTitle()) { | 345 if (new_title != node->GetTitle()) { |
| 345 model->SetTitle(node, new_title); | 346 model->SetTitle(node, new_title); |
| 346 content::RecordAction( | 347 content::RecordAction( |
| 347 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); | 348 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); |
| 348 } | 349 } |
| 349 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); | 350 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); |
| 350 } | 351 } |
| 351 } | 352 } |
| OLD | NEW |