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

Side by Side Diff: chrome/browser/chromeos/ui/focus_ring_controller.h

Issue 537893003: Move view logic from FocusRingLayer to FocusRingController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@focus_ring_0_force_on
Patch Set: Created 6 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_CHROMEOS_UI_FOCUS_RING_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_UI_FOCUS_RING_CONTROLLER_H_
6 #define CHROME_BROWSER_CHROMEOS_UI_FOCUS_RING_CONTROLLER_H_ 6 #define CHROME_BROWSER_CHROMEOS_UI_FOCUS_RING_CONTROLLER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/chromeos/ui/focus_ring_layer.h"
10 #include "ui/views/focus/focus_manager.h" 11 #include "ui/views/focus/focus_manager.h"
11 #include "ui/views/focus/widget_focus_manager.h" 12 #include "ui/views/focus/widget_focus_manager.h"
12 #include "ui/views/widget/widget_observer.h" 13 #include "ui/views/widget/widget_observer.h"
13 14
14 namespace views { 15 namespace views {
15 class View; 16 class View;
16 class Widget; 17 class Widget;
17 } 18 }
18 19
19 namespace chromeos { 20 namespace chromeos {
20 21
21 class FocusRingLayer;
22
23 // FocusRingController manages the focus ring around the focused view. It 22 // FocusRingController manages the focus ring around the focused view. It
24 // follows widget focus change and update the focus ring layer when the focused 23 // follows widget focus change and update the focus ring layer when the focused
25 // view of the widget changes. 24 // view of the widget changes.
26 class FocusRingController : public views::WidgetObserver, 25 class FocusRingController : public FocusRingLayerDelegate,
26 public views::WidgetObserver,
27 public views::WidgetFocusChangeListener, 27 public views::WidgetFocusChangeListener,
28 public views::FocusChangeListener { 28 public views::FocusChangeListener {
29 public: 29 public:
30 FocusRingController(); 30 FocusRingController();
31 virtual ~FocusRingController(); 31 virtual ~FocusRingController();
32 32
33 // Turns on/off the focus ring. 33 // Turns on/off the focus ring.
34 void SetVisible(bool visible); 34 void SetVisible(bool visible);
35 35
36 private: 36 private:
37 // FocusRingLayerDelegate.
38 virtual void OnDeviceScaleFactorChanged() OVERRIDE;
39
37 // Sets the focused |widget|. 40 // Sets the focused |widget|.
38 void SetWidget(views::Widget* widget); 41 void SetWidget(views::Widget* widget);
39 42
40 // Updates the focus ring to the focused view of |widget_|. If |widget_| is 43 // Updates the focus ring to the focused view of |widget_|. If |widget_| is
41 // NULL or has no focused view, removes the focus ring. Otherwise, draws it. 44 // NULL or has no focused view, removes the focus ring. Otherwise, draws it.
42 void UpdateFocusRing(); 45 void UpdateFocusRing();
43 46
44 // views::WidgetObserver overrides: 47 // views::WidgetObserver overrides:
45 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; 48 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE;
46 virtual void OnWidgetBoundsChanged(views::Widget* widget, 49 virtual void OnWidgetBoundsChanged(views::Widget* widget,
(...skipping 13 matching lines...) Expand all
60 63
61 views::Widget* widget_; 64 views::Widget* widget_;
62 scoped_ptr<FocusRingLayer> focus_ring_layer_; 65 scoped_ptr<FocusRingLayer> focus_ring_layer_;
63 66
64 DISALLOW_COPY_AND_ASSIGN(FocusRingController); 67 DISALLOW_COPY_AND_ASSIGN(FocusRingController);
65 }; 68 };
66 69
67 } // namespace chromeos 70 } // namespace chromeos
68 71
69 #endif // CHROME_BROWSER_CHROMEOS_UI_FOCUS_RING_CONTROLLER_H_ 72 #endif // CHROME_BROWSER_CHROMEOS_UI_FOCUS_RING_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698