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

Side by Side Diff: chrome/browser/ui/views/autofill/autofill_dialog_views.cc

Issue 108063004: Give up focus if the focused view becomes unfocusable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years 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) 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/autofill/autofill_dialog_views.h" 5 #include "chrome/browser/ui/views/autofill/autofill_dialog_views.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 SetLayoutManager( 472 SetLayoutManager(
473 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 473 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0,
474 kAroundTextPadding)); 474 kAroundTextPadding));
475 AddChildView(image_); 475 AddChildView(image_);
476 476
477 menu_button_->set_background(NULL); 477 menu_button_->set_background(NULL);
478 menu_button_->set_border(NULL); 478 menu_button_->set_border(NULL);
479 gfx::Insets insets = GetInsets(); 479 gfx::Insets insets = GetInsets();
480 menu_button_->SetFocusPainter( 480 menu_button_->SetFocusPainter(
481 views::Painter::CreateDashedFocusPainterWithInsets(insets)); 481 views::Painter::CreateDashedFocusPainterWithInsets(insets));
482 menu_button_->set_focusable(true); 482 menu_button_->SetFocusable(true);
483 AddChildView(menu_button_); 483 AddChildView(menu_button_);
484 484
485 link_->set_listener(this); 485 link_->set_listener(this);
486 AddChildView(link_); 486 AddChildView(link_);
487 } 487 }
488 488
489 AutofillDialogViews::AccountChooser::~AccountChooser() {} 489 AutofillDialogViews::AccountChooser::~AccountChooser() {}
490 490
491 void AutofillDialogViews::AccountChooser::Update() { 491 void AutofillDialogViews::AccountChooser::Update() {
492 SetVisible(!delegate_->ShouldShowSpinner()); 492 SetVisible(!delegate_->ShouldShowSpinner());
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 const int kFocusBorderWidth = 1; 930 const int kFocusBorderWidth = 1;
931 set_border(views::Border::CreateEmptyBorder(kMenuButtonTopInset, 931 set_border(views::Border::CreateEmptyBorder(kMenuButtonTopInset,
932 kDialogEdgePadding, 932 kDialogEdgePadding,
933 kMenuButtonBottomInset, 933 kMenuButtonBottomInset,
934 kFocusBorderWidth)); 934 kFocusBorderWidth));
935 gfx::Insets insets = GetInsets(); 935 gfx::Insets insets = GetInsets();
936 insets += gfx::Insets(-kFocusBorderWidth, -kFocusBorderWidth, 936 insets += gfx::Insets(-kFocusBorderWidth, -kFocusBorderWidth,
937 -kFocusBorderWidth, -kFocusBorderWidth); 937 -kFocusBorderWidth, -kFocusBorderWidth);
938 SetFocusPainter( 938 SetFocusPainter(
939 views::Painter::CreateDashedFocusPainterWithInsets(insets)); 939 views::Painter::CreateDashedFocusPainterWithInsets(insets));
940 set_focusable(true); 940 SetFocusable(true);
941 } 941 }
942 942
943 AutofillDialogViews::SuggestedButton::~SuggestedButton() {} 943 AutofillDialogViews::SuggestedButton::~SuggestedButton() {}
944 944
945 gfx::Size AutofillDialogViews::SuggestedButton::GetPreferredSize() { 945 gfx::Size AutofillDialogViews::SuggestedButton::GetPreferredSize() {
946 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 946 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
947 gfx::Size size = rb.GetImageNamed(ResourceIDForState()).Size(); 947 gfx::Size size = rb.GetImageNamed(ResourceIDForState()).Size();
948 const gfx::Insets insets = GetInsets(); 948 const gfx::Insets insets = GetInsets();
949 size.Enlarge(insets.width(), insets.height()); 949 size.Enlarge(insets.width(), insets.height());
950 return size; 950 return size;
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
2449 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) 2449 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section)
2450 : section(section), 2450 : section(section),
2451 container(NULL), 2451 container(NULL),
2452 manual_input(NULL), 2452 manual_input(NULL),
2453 suggested_info(NULL), 2453 suggested_info(NULL),
2454 suggested_button(NULL) {} 2454 suggested_button(NULL) {}
2455 2455
2456 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} 2456 AutofillDialogViews::DetailsGroup::~DetailsGroup() {}
2457 2457
2458 } // namespace autofill 2458 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698