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

Unified Diff: ui/views/examples/button_example.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 side-by-side diff with in-line comments
Download patch
Index: ui/views/examples/button_example.cc
diff --git a/ui/views/examples/button_example.cc b/ui/views/examples/button_example.cc
index de81072d9efc522ac57240d34647ad7410504ee6..c963949272e7841ba36efb7cee49625783f618ba 100644
--- a/ui/views/examples/button_example.cc
+++ b/ui/views/examples/button_example.cc
@@ -48,11 +48,11 @@ void ButtonExample::CreateExampleView(View* container) {
container->SetLayoutManager(new BoxLayout(BoxLayout::kVertical, 10, 10, 10));
text_button_ = new TextButton(this, ASCIIToUTF16(kTextButton));
- text_button_->set_focusable(true);
+ text_button_->SetFocusable(true);
container->AddChildView(text_button_);
label_button_ = new LabelButton(this, ASCIIToUTF16(kLabelButton));
- label_button_->set_focusable(true);
+ label_button_->SetFocusable(true);
container->AddChildView(label_button_);
LabelButton* disabled_button =
@@ -65,7 +65,7 @@ void ButtonExample::CreateExampleView(View* container) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
image_button_ = new ImageButton(this);
- image_button_->set_focusable(true);
+ image_button_->SetFocusable(true);
image_button_->SetImage(ImageButton::STATE_NORMAL,
rb.GetImageNamed(IDR_CLOSE).ToImageSkia());
image_button_->SetImage(ImageButton::STATE_HOVERED,
@@ -160,7 +160,7 @@ void ButtonExample::LabelButtonPressed(const ui::Event& event) {
}
} else if (event.IsShiftDown()) {
if (event.IsAltDown()) {
- label_button_->set_focusable(!label_button_->focusable());
+ label_button_->SetFocusable(!label_button_->focusable());
} else {
label_button_->SetStyle(static_cast<Button::ButtonStyle>(
(label_button_->style() + 1) % Button::STYLE_COUNT));

Powered by Google App Engine
This is Rietveld 408576698