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

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

Issue 125148: Making FocusManager portable to toolkit_views (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
« no previous file with comments | « chrome/browser/views/infobars/infobars.cc ('k') | chrome/browser/views/status_bubble_views.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/shelf_item_dialog.h" 5 #include "chrome/browser/views/shelf_item_dialog.h"
6 6
7 #include "app/gfx/text_elider.h" 7 #include "app/gfx/text_elider.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 "app/table_model.h" 10 #include "app/table_model.h"
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 return gfx::Size(views::Window::GetLocalizedContentsSize( 469 return gfx::Size(views::Window::GetLocalizedContentsSize(
470 IDS_SHELFITEM_DIALOG_WIDTH_CHARS, 470 IDS_SHELFITEM_DIALOG_WIDTH_CHARS,
471 IDS_SHELFITEM_DIALOG_HEIGHT_LINES)); 471 IDS_SHELFITEM_DIALOG_HEIGHT_LINES));
472 } 472 }
473 473
474 bool ShelfItemDialog::AcceleratorPressed( 474 bool ShelfItemDialog::AcceleratorPressed(
475 const views::Accelerator& accelerator) { 475 const views::Accelerator& accelerator) {
476 if (accelerator.GetKeyCode() == VK_ESCAPE) { 476 if (accelerator.GetKeyCode() == VK_ESCAPE) {
477 window()->Close(); 477 window()->Close();
478 } else if (accelerator.GetKeyCode() == VK_RETURN) { 478 } else if (accelerator.GetKeyCode() == VK_RETURN) {
479 views::FocusManager* fm = views::FocusManager::GetFocusManager( 479 views::FocusManager* fm = GetFocusManager();
480 GetWidget()->GetNativeView());
481 if (fm->GetFocusedView() == url_table_) { 480 if (fm->GetFocusedView() == url_table_) {
482 // Return on table behaves like a double click. 481 // Return on table behaves like a double click.
483 OnDoubleClick(); 482 OnDoubleClick();
484 } else if (fm->GetFocusedView()== url_field_) { 483 } else if (fm->GetFocusedView()== url_field_) {
485 // Return on the url field accepts the input if url is valid. If the URL 484 // Return on the url field accepts the input if url is valid. If the URL
486 // is invalid, focus is left on the url field. 485 // is invalid, focus is left on the url field.
487 if (GetInputURL().is_valid()) { 486 if (GetInputURL().is_valid()) {
488 PerformModelChange(); 487 PerformModelChange();
489 if (window()) 488 if (window())
490 window()->Close(); 489 window()->Close();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 OnSelectionChanged(); 521 OnSelectionChanged();
523 PerformModelChange(); 522 PerformModelChange();
524 if (window()) 523 if (window())
525 window()->Close(); 524 window()->Close();
526 } 525 }
527 } 526 }
528 527
529 GURL ShelfItemDialog::GetInputURL() const { 528 GURL ShelfItemDialog::GetInputURL() const {
530 return GURL(URLFixerUpper::FixupURL(url_field_->text(), L"")); 529 return GURL(URLFixerUpper::FixupURL(url_field_->text(), L""));
531 } 530 }
OLDNEW
« no previous file with comments | « chrome/browser/views/infobars/infobars.cc ('k') | chrome/browser/views/status_bubble_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698