| 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_PANELS_PANEL_BROWSER_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_VIEW_H_ | 6 #define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/time.h" | 11 #include "base/time.h" |
| 12 #include "chrome/browser/ui/panels/native_panel.h" | 12 #include "chrome/browser/ui/panels/native_panel.h" |
| 13 #include "chrome/browser/ui/views/frame/browser_view.h" | 13 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 14 #include "ui/base/animation/animation_delegate.h" | 14 #include "ui/base/animation/animation_delegate.h" |
| 15 | 15 |
| 16 class Browser; | 16 class Browser; |
| 17 class Panel; | 17 class Panel; |
| 18 class NativePanelTestingWin; | 18 class NativePanelTestingWin; |
| 19 class PanelBrowserFrameView; | 19 class PanelBrowserFrameView; |
| 20 namespace ui { | 20 class CustomSlideAnimation; |
| 21 class SlideAnimation; | |
| 22 } | |
| 23 | 21 |
| 24 // A browser view that implements Panel specific behavior. | 22 // A browser view that implements Panel specific behavior. |
| 25 class PanelBrowserView : public BrowserView, | 23 class PanelBrowserView : public BrowserView, |
| 26 public NativePanel, | 24 public NativePanel, |
| 27 public ui::AnimationDelegate { | 25 public ui::AnimationDelegate { |
| 28 public: | 26 public: |
| 29 PanelBrowserView(Browser* browser, Panel* panel, const gfx::Rect& bounds); | 27 PanelBrowserView(Browser* browser, Panel* panel, const gfx::Rect& bounds); |
| 30 virtual ~PanelBrowserView(); | 28 virtual ~PanelBrowserView(); |
| 31 | 29 |
| 32 Panel* panel() const { return panel_.get(); } | 30 Panel* panel() const { return panel_.get(); } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 gfx::Point mouse_location_; | 137 gfx::Point mouse_location_; |
| 140 | 138 |
| 141 // Timestamp when the mouse was pressed. Used to detect long click. | 139 // Timestamp when the mouse was pressed. Used to detect long click. |
| 142 base::TimeTicks mouse_pressed_time_; | 140 base::TimeTicks mouse_pressed_time_; |
| 143 | 141 |
| 144 // Is the titlebar currently being dragged? That is, has the cursor | 142 // Is the titlebar currently being dragged? That is, has the cursor |
| 145 // moved more than kDragThreshold away from its starting position? | 143 // moved more than kDragThreshold away from its starting position? |
| 146 MouseDraggingState mouse_dragging_state_; | 144 MouseDraggingState mouse_dragging_state_; |
| 147 | 145 |
| 148 // Used to animate the bounds change. | 146 // Used to animate the bounds change. |
| 149 scoped_ptr<ui::SlideAnimation> bounds_animator_; | 147 scoped_ptr<CustomSlideAnimation> bounds_animator_; |
| 150 gfx::Rect animation_start_bounds_; | 148 gfx::Rect animation_start_bounds_; |
| 151 | 149 |
| 152 // Is the panel in highlighted state to draw people's attention? | 150 // Is the panel in highlighted state to draw people's attention? |
| 153 bool is_drawing_attention_; | 151 bool is_drawing_attention_; |
| 154 | 152 |
| 155 // Timestamp to prevent minimizing the panel when the user clicks the titlebar | 153 // Timestamp to prevent minimizing the panel when the user clicks the titlebar |
| 156 // to clear the attension state. | 154 // to clear the attension state. |
| 157 base::TimeTicks attention_cleared_time_; | 155 base::TimeTicks attention_cleared_time_; |
| 158 | 156 |
| 159 // The last view that had focus in the panel. This is saved so that focus can | 157 // The last view that had focus in the panel. This is saved so that focus can |
| 160 // be restored properly when a drag ends. | 158 // be restored properly when a drag ends. |
| 161 views::View* old_focused_view_; | 159 views::View* old_focused_view_; |
| 162 | 160 |
| 163 DISALLOW_COPY_AND_ASSIGN(PanelBrowserView); | 161 DISALLOW_COPY_AND_ASSIGN(PanelBrowserView); |
| 164 }; | 162 }; |
| 165 | 163 |
| 166 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_VIEW_H_ | 164 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_VIEW_H_ |
| OLD | NEW |