OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_VIEWS_DROPDOWN_BAR_HOST_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_HOST_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_HOST_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_HOST_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "content/public/browser/native_web_keyboard_event.h" | 12 #include "content/public/browser/native_web_keyboard_event.h" |
12 #include "ui/gfx/animation/animation_delegate.h" | 13 #include "ui/gfx/animation/animation_delegate.h" |
13 #include "ui/gfx/geometry/rect.h" | 14 #include "ui/gfx/geometry/rect.h" |
14 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
15 #include "ui/views/focus/focus_manager.h" | 16 #include "ui/views/focus/focus_manager.h" |
16 | 17 |
17 class BrowserView; | 18 class BrowserView; |
18 class DropdownBarHostDelegate; | 19 class DropdownBarHostDelegate; |
19 class DropdownBarView; | 20 class DropdownBarView; |
20 | 21 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 void SetHostViewNative(views::View* host_view); | 153 void SetHostViewNative(views::View* host_view); |
153 | 154 |
154 // The BrowserView that created us. | 155 // The BrowserView that created us. |
155 BrowserView* browser_view_; | 156 BrowserView* browser_view_; |
156 | 157 |
157 // Our view, which is responsible for drawing the UI. | 158 // Our view, which is responsible for drawing the UI. |
158 views::View* view_; | 159 views::View* view_; |
159 DropdownBarHostDelegate* delegate_; | 160 DropdownBarHostDelegate* delegate_; |
160 | 161 |
161 // The animation class to use when opening the Dropdown widget. | 162 // The animation class to use when opening the Dropdown widget. |
162 scoped_ptr<gfx::SlideAnimation> animation_; | 163 std::unique_ptr<gfx::SlideAnimation> animation_; |
163 | 164 |
164 // The focus manager we register with to keep track of focus changes. | 165 // The focus manager we register with to keep track of focus changes. |
165 views::FocusManager* focus_manager_; | 166 views::FocusManager* focus_manager_; |
166 | 167 |
167 // True if the accelerator target for Esc key is registered. | 168 // True if the accelerator target for Esc key is registered. |
168 bool esc_accel_target_registered_; | 169 bool esc_accel_target_registered_; |
169 | 170 |
170 // Tracks and stores the last focused view which is not the DropdownBarView | 171 // Tracks and stores the last focused view which is not the DropdownBarView |
171 // or any of its children. Used to restore focus once the DropdownBarView is | 172 // or any of its children. Used to restore focus once the DropdownBarView is |
172 // closed. | 173 // closed. |
173 scoped_ptr<views::ExternalFocusTracker> focus_tracker_; | 174 std::unique_ptr<views::ExternalFocusTracker> focus_tracker_; |
174 | 175 |
175 // Host is the Widget implementation that is created and maintained by the | 176 // Host is the Widget implementation that is created and maintained by the |
176 // dropdown bar. It contains the DropdownBarView. | 177 // dropdown bar. It contains the DropdownBarView. |
177 scoped_ptr<views::Widget> host_; | 178 std::unique_ptr<views::Widget> host_; |
178 | 179 |
179 // A flag to manually manage visibility. GTK/X11 is asynchronous and | 180 // A flag to manually manage visibility. GTK/X11 is asynchronous and |
180 // the state of the widget can be out of sync. | 181 // the state of the widget can be out of sync. |
181 bool is_visible_; | 182 bool is_visible_; |
182 | 183 |
183 DISALLOW_COPY_AND_ASSIGN(DropdownBarHost); | 184 DISALLOW_COPY_AND_ASSIGN(DropdownBarHost); |
184 }; | 185 }; |
185 | 186 |
186 #endif // CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_HOST_H_ | 187 #endif // CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_HOST_H_ |
OLD | NEW |