OLD | NEW |
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 #ifndef CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_VIEW_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "build/build_config.h" | 11 #include "build/build_config.h" |
11 #include "chrome/browser/ui/panels/native_panel.h" | 12 #include "chrome/browser/ui/panels/native_panel.h" |
12 #include "ui/gfx/animation/animation_delegate.h" | 13 #include "ui/gfx/animation/animation_delegate.h" |
13 #include "ui/views/widget/widget_delegate.h" | 14 #include "ui/views/widget/widget_delegate.h" |
14 #include "ui/views/widget/widget_observer.h" | 15 #include "ui/views/widget/widget_observer.h" |
15 | 16 |
16 #if defined(OS_WIN) | 17 #if defined(OS_WIN) |
17 #include "ui/base/win/hwnd_subclass.h" | 18 #include "ui/base/win/hwnd_subclass.h" |
18 #endif | 19 #endif |
19 | 20 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 #if defined(OS_WIN) | 171 #if defined(OS_WIN) |
171 // Sets |attribute_value_to_set| and/or clears |attribute_value_to_reset| for | 172 // Sets |attribute_value_to_set| and/or clears |attribute_value_to_reset| for |
172 // the attibute denoted by |attribute_index|. This is used to update the style | 173 // the attibute denoted by |attribute_index|. This is used to update the style |
173 // or extended style for the native window. | 174 // or extended style for the native window. |
174 void UpdateWindowAttribute(int attribute_index, | 175 void UpdateWindowAttribute(int attribute_index, |
175 int attribute_value_to_set, | 176 int attribute_value_to_set, |
176 int attribute_value_to_reset, | 177 int attribute_value_to_reset, |
177 bool update_frame); | 178 bool update_frame); |
178 #endif | 179 #endif |
179 | 180 |
180 scoped_ptr<Panel> panel_; | 181 std::unique_ptr<Panel> panel_; |
181 gfx::Rect bounds_; | 182 gfx::Rect bounds_; |
182 | 183 |
183 // The window that holds all panel views. Lifetime managed by native widget. | 184 // The window that holds all panel views. Lifetime managed by native widget. |
184 // See widget.h. | 185 // See widget.h. |
185 views::Widget* window_; | 186 views::Widget* window_; |
186 | 187 |
187 // Close gets called more than once, so use this to do one-time clean up once. | 188 // Close gets called more than once, so use this to do one-time clean up once. |
188 bool window_closed_; | 189 bool window_closed_; |
189 | 190 |
190 // The view hosting the web contents. Will be destroyed when child views | 191 // The view hosting the web contents. Will be destroyed when child views |
(...skipping 28 matching lines...) Expand all Loading... |
219 // Location the mouse was pressed at or dragged to last time when we process | 220 // Location the mouse was pressed at or dragged to last time when we process |
220 // the mouse event. Used in drag-and-drop. | 221 // the mouse event. Used in drag-and-drop. |
221 // This point is represented in the screen coordinate system. | 222 // This point is represented in the screen coordinate system. |
222 gfx::Point last_mouse_location_; | 223 gfx::Point last_mouse_location_; |
223 | 224 |
224 // Is the titlebar currently being dragged? That is, has the cursor | 225 // Is the titlebar currently being dragged? That is, has the cursor |
225 // moved more than kDragThreshold away from its starting position? | 226 // moved more than kDragThreshold away from its starting position? |
226 MouseDraggingState mouse_dragging_state_; | 227 MouseDraggingState mouse_dragging_state_; |
227 | 228 |
228 // Used to animate the bounds change. | 229 // Used to animate the bounds change. |
229 scoped_ptr<PanelBoundsAnimation> bounds_animator_; | 230 std::unique_ptr<PanelBoundsAnimation> bounds_animator_; |
230 gfx::Rect animation_start_bounds_; | 231 gfx::Rect animation_start_bounds_; |
231 | 232 |
232 // Is the panel in highlighted state to draw people's attention? | 233 // Is the panel in highlighted state to draw people's attention? |
233 bool is_drawing_attention_; | 234 bool is_drawing_attention_; |
234 | 235 |
235 // Should we force to paint the panel as inactive? This is needed when we need | 236 // Should we force to paint the panel as inactive? This is needed when we need |
236 // to capture the screenshot before an active panel goes minimized. | 237 // to capture the screenshot before an active panel goes minimized. |
237 bool force_to_paint_as_inactive_; | 238 bool force_to_paint_as_inactive_; |
238 | 239 |
239 // The last view that had focus in the panel. This is saved so that focus can | 240 // The last view that had focus in the panel. This is saved so that focus can |
240 // be restored properly when a drag ends. | 241 // be restored properly when a drag ends. |
241 views::View* old_focused_view_; | 242 views::View* old_focused_view_; |
242 | 243 |
243 scoped_ptr<ScopedKeepAlive> keep_alive_; | 244 std::unique_ptr<ScopedKeepAlive> keep_alive_; |
244 | 245 |
245 #if defined(OS_WIN) | 246 #if defined(OS_WIN) |
246 // Used to provide custom taskbar thumbnail for Windows 7 and later. | 247 // Used to provide custom taskbar thumbnail for Windows 7 and later. |
247 scoped_ptr<TaskbarWindowThumbnailerWin> thumbnailer_; | 248 std::unique_ptr<TaskbarWindowThumbnailerWin> thumbnailer_; |
248 #endif | 249 #endif |
249 | 250 |
250 DISALLOW_COPY_AND_ASSIGN(PanelView); | 251 DISALLOW_COPY_AND_ASSIGN(PanelView); |
251 }; | 252 }; |
252 | 253 |
253 #endif // CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_VIEW_H_ | 254 #endif // CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_VIEW_H_ |
OLD | NEW |