Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Side by Side Diff: chrome/browser/views/bookmark_bubble_view.cc

Issue 141013: Relanding focus manager refactoring (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/gfx/canvas.h" 7 #include "app/gfx/canvas.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "app/resource_bundle.h" 9 #include "app/resource_bundle.h"
10 #include "chrome/app/chrome_dll_resource.h" 10 #include "chrome/app/chrome_dll_resource.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 } 176 }
177 177
178 void BookmarkBubbleView::DidChangeBounds(const gfx::Rect& previous, 178 void BookmarkBubbleView::DidChangeBounds(const gfx::Rect& previous,
179 const gfx::Rect& current) { 179 const gfx::Rect& current) {
180 Layout(); 180 Layout();
181 } 181 }
182 182
183 void BookmarkBubbleView::BubbleShown() { 183 void BookmarkBubbleView::BubbleShown() {
184 DCHECK(GetWidget()); 184 DCHECK(GetWidget());
185 views::FocusManager* focus_manager = 185 GetFocusManager()->RegisterAccelerator(
186 views::FocusManager::GetFocusManager(GetWidget()->GetNativeView());
187 focus_manager->RegisterAccelerator(
188 views::Accelerator(VK_RETURN, false, false, false), this); 186 views::Accelerator(VK_RETURN, false, false, false), this);
189 187
190 title_tf_->RequestFocus(); 188 title_tf_->RequestFocus();
191 title_tf_->SelectAll(); 189 title_tf_->SelectAll();
192 } 190 }
193 191
194 bool BookmarkBubbleView::AcceleratorPressed( 192 bool BookmarkBubbleView::AcceleratorPressed(
195 const views::Accelerator& accelerator) { 193 const views::Accelerator& accelerator) {
196 if (accelerator.GetKeyCode() != VK_RETURN) 194 if (accelerator.GetKeyCode() != VK_RETURN)
197 return false; 195 return false;
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 parent_model_.GetItemCount(parent_combobox_) - 1) { 419 parent_model_.GetItemCount(parent_combobox_) - 1) {
422 BookmarkNode* new_parent = 420 BookmarkNode* new_parent =
423 parent_model_.GetNodeAt(parent_combobox_->selected_item()); 421 parent_model_.GetNodeAt(parent_combobox_->selected_item());
424 if (new_parent != node->GetParent()) { 422 if (new_parent != node->GetParent()) {
425 UserMetrics::RecordAction(L"BookmarkBubble_ChangeParent", profile_); 423 UserMetrics::RecordAction(L"BookmarkBubble_ChangeParent", profile_);
426 model->Move(node, new_parent, new_parent->GetChildCount()); 424 model->Move(node, new_parent, new_parent->GetChildCount());
427 } 425 }
428 } 426 }
429 } 427 }
430 } 428 }
OLDNEW
« no previous file with comments | « chrome/browser/views/blocked_popup_container_view_win.cc ('k') | chrome/browser/views/browser_bubble_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698