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/strings/string16.h" | 7 #include "base/strings/string16.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
95 } | 95 } |
96 // |parent_combobox_| needs to be destroyed before |parent_model_| as it | 96 // |parent_combobox_| needs to be destroyed before |parent_model_| as it |
97 // uses |parent_model_| in its destructor. | 97 // uses |parent_model_| in its destructor. |
98 delete parent_combobox_; | 98 delete parent_combobox_; |
99 } | 99 } |
100 | 100 |
101 views::View* BookmarkBubbleView::GetInitiallyFocusedView() { | 101 views::View* BookmarkBubbleView::GetInitiallyFocusedView() { |
102 return title_tf_; | 102 return title_tf_; |
103 } | 103 } |
104 | 104 |
105 void BookmarkBubbleView::OnWidgetBoundsChanged(views::Widget* widget, | |
106 const gfx::Rect& new_bounds) { | |
107 if (anchor_widget() == widget) | |
msw
2013/11/27 00:09:40
I think all bubbles should do this if they haven't
| |
108 GetWidget()->Close(); | |
109 } | |
110 | |
105 void BookmarkBubbleView::WindowClosing() { | 111 void BookmarkBubbleView::WindowClosing() { |
106 // We have to reset |bubble_| here, not in our destructor, because we'll be | 112 // We have to reset |bubble_| here, not in our destructor, because we'll be |
107 // destroyed asynchronously and the shown state will be checked before then. | 113 // destroyed asynchronously and the shown state will be checked before then. |
108 DCHECK_EQ(bookmark_bubble_, this); | 114 DCHECK_EQ(bookmark_bubble_, this); |
109 bookmark_bubble_ = NULL; | 115 bookmark_bubble_ = NULL; |
110 | 116 |
111 if (observer_) | 117 if (observer_) |
112 observer_->OnBookmarkBubbleHidden(); | 118 observer_->OnBookmarkBubbleHidden(); |
113 } | 119 } |
114 | 120 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
355 if (node) { | 361 if (node) { |
356 const string16 new_title = title_tf_->text(); | 362 const string16 new_title = title_tf_->text(); |
357 if (new_title != node->GetTitle()) { | 363 if (new_title != node->GetTitle()) { |
358 model->SetTitle(node, new_title); | 364 model->SetTitle(node, new_title); |
359 content::RecordAction( | 365 content::RecordAction( |
360 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); | 366 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); |
361 } | 367 } |
362 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); | 368 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); |
363 } | 369 } |
364 } | 370 } |
OLD | NEW |