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

Side by Side Diff: ash/shell/lock_view.cc

Issue 1894383002: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SetFocusBehavior
Patch Set: Rebased. Created 4 years, 8 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
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 "ash/session/session_state_delegate.h" 5 #include "ash/session/session_state_delegate.h"
6 #include "ash/shell.h" 6 #include "ash/shell.h"
7 #include "ash/shell/example_factory.h" 7 #include "ash/shell/example_factory.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 12 matching lines...) Expand all
23 namespace ash { 23 namespace ash {
24 namespace shell { 24 namespace shell {
25 25
26 class LockView : public views::WidgetDelegateView, 26 class LockView : public views::WidgetDelegateView,
27 public views::ButtonListener { 27 public views::ButtonListener {
28 public: 28 public:
29 LockView() : unlock_button_(new views::LabelButton( 29 LockView() : unlock_button_(new views::LabelButton(
30 this, base::ASCIIToUTF16("Unlock"))) { 30 this, base::ASCIIToUTF16("Unlock"))) {
31 unlock_button_->SetStyle(views::Button::STYLE_BUTTON); 31 unlock_button_->SetStyle(views::Button::STYLE_BUTTON);
32 AddChildView(unlock_button_); 32 AddChildView(unlock_button_);
33 unlock_button_->SetFocusBehavior(FocusBehavior::ALWAYS); 33 views::Button::ConfigureDefaultFocus(unlock_button_);
tapted 2016/04/20 06:05:57 It feels inconsistent to flip things around when c
karandeepb 2016/05/03 02:54:12 I used a static method because I thought it was be
tapted 2016/05/03 08:08:25 Ack. Thanks for investigating that! I wonder if it
karandeepb 2016/05/04 01:56:38 Yup I was also a bit surprised by this. But LabelB
34 } 34 }
35 ~LockView() override {} 35 ~LockView() override {}
36 36
37 // Overridden from views::View: 37 // Overridden from views::View:
38 gfx::Size GetPreferredSize() const override { return gfx::Size(500, 400); } 38 gfx::Size GetPreferredSize() const override { return gfx::Size(500, 400); }
39 39
40 private: 40 private:
41 // Overridden from views::View: 41 // Overridden from views::View:
42 void OnPaint(gfx::Canvas* canvas) override { 42 void OnPaint(gfx::Canvas* canvas) override {
43 canvas->FillRect(GetLocalBounds(), SK_ColorYELLOW); 43 canvas->FillRect(GetLocalBounds(), SK_ColorYELLOW);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 widget->GetNativeView()->SetName("LockView"); 99 widget->GetNativeView()->SetName("LockView");
100 widget->GetNativeView()->Focus(); 100 widget->GetNativeView()->Focus();
101 101
102 // TODO: it shouldn't be necessary to invoke UpdateTooltip() here. 102 // TODO: it shouldn't be necessary to invoke UpdateTooltip() here.
103 Shell::GetInstance()->tooltip_controller()->UpdateTooltip( 103 Shell::GetInstance()->tooltip_controller()->UpdateTooltip(
104 widget->GetNativeView()); 104 widget->GetNativeView());
105 } 105 }
106 106
107 } // namespace shell 107 } // namespace shell
108 } // namespace ash 108 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/system/tray/tray_popup_header_button.cc » ('j') | ash/system/tray/tray_popup_header_button.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698