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" | |
8 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
9 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/keyboard_codes.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "chrome/app/chrome_dll_resource.h" | 12 #include "chrome/app/chrome_dll_resource.h" |
13 #include "chrome/browser/bookmarks/bookmark_editor.h" | 13 #include "chrome/browser/bookmarks/bookmark_editor.h" |
14 #include "chrome/browser/bookmarks/bookmark_model.h" | 14 #include "chrome/browser/bookmarks/bookmark_model.h" |
15 #include "chrome/browser/bookmarks/bookmark_utils.h" | 15 #include "chrome/browser/bookmarks/bookmark_utils.h" |
16 #include "chrome/browser/metrics/user_metrics.h" | 16 #include "chrome/browser/metrics/user_metrics.h" |
17 #include "chrome/browser/profile.h" | 17 #include "chrome/browser/profile.h" |
18 #include "chrome/browser/views/info_bubble.h" | 18 #include "chrome/browser/views/info_bubble.h" |
19 #include "chrome/common/notification_service.h" | 19 #include "chrome/common/notification_service.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 122 } |
123 | 123 |
124 void BookmarkBubbleView::DidChangeBounds(const gfx::Rect& previous, | 124 void BookmarkBubbleView::DidChangeBounds(const gfx::Rect& previous, |
125 const gfx::Rect& current) { | 125 const gfx::Rect& current) { |
126 Layout(); | 126 Layout(); |
127 } | 127 } |
128 | 128 |
129 void BookmarkBubbleView::BubbleShown() { | 129 void BookmarkBubbleView::BubbleShown() { |
130 DCHECK(GetWidget()); | 130 DCHECK(GetWidget()); |
131 GetFocusManager()->RegisterAccelerator( | 131 GetFocusManager()->RegisterAccelerator( |
132 views::Accelerator(app::VKEY_RETURN, false, false, false), this); | 132 views::Accelerator(base::VKEY_RETURN, false, false, false), this); |
133 | 133 |
134 title_tf_->RequestFocus(); | 134 title_tf_->RequestFocus(); |
135 title_tf_->SelectAll(); | 135 title_tf_->SelectAll(); |
136 } | 136 } |
137 | 137 |
138 bool BookmarkBubbleView::AcceleratorPressed( | 138 bool BookmarkBubbleView::AcceleratorPressed( |
139 const views::Accelerator& accelerator) { | 139 const views::Accelerator& accelerator) { |
140 if (accelerator.GetKeyCode() != app::VKEY_RETURN) | 140 if (accelerator.GetKeyCode() != base::VKEY_RETURN) |
141 return false; | 141 return false; |
142 | 142 |
143 if (edit_button_->HasFocus()) | 143 if (edit_button_->HasFocus()) |
144 HandleButtonPressed(edit_button_); | 144 HandleButtonPressed(edit_button_); |
145 else | 145 else |
146 HandleButtonPressed(close_button_); | 146 HandleButtonPressed(close_button_); |
147 return true; | 147 return true; |
148 } | 148 } |
149 | 149 |
150 void BookmarkBubbleView::ViewHierarchyChanged(bool is_add, View* parent, | 150 void BookmarkBubbleView::ViewHierarchyChanged(bool is_add, View* parent, |
(...skipping 253 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 |