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 "chrome/browser/ui/views/frame/browser_view.h" | 10 #include "chrome/browser/ui/views/frame/browser_view.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // Called from frame view when title bar receives a mouse event. | 24 // Called from frame view when title bar receives a mouse event. |
25 // Return true if the event is handled. | 25 // Return true if the event is handled. |
26 bool OnTitleBarMousePressed(const views::MouseEvent& event); | 26 bool OnTitleBarMousePressed(const views::MouseEvent& event); |
27 bool OnTitleBarMouseDragged(const views::MouseEvent& event); | 27 bool OnTitleBarMouseDragged(const views::MouseEvent& event); |
28 bool OnTitleBarMouseReleased(const views::MouseEvent& event); | 28 bool OnTitleBarMouseReleased(const views::MouseEvent& event); |
29 bool OnTitleBarMouseCaptureLost(); | 29 bool OnTitleBarMouseCaptureLost(); |
30 | 30 |
31 private: | 31 private: |
32 friend class PanelBrowserViewTest; | 32 friend class PanelBrowserViewTest; |
33 FRIEND_TEST_ALL_PREFIXES(PanelBrowserViewTest, CreatePanel); | 33 FRIEND_TEST_ALL_PREFIXES(PanelBrowserViewTest, CreatePanel); |
| 34 FRIEND_TEST_ALL_PREFIXES(PanelBrowserViewTest, ShowOrHideInfoButton); |
34 | 35 |
35 // Overridden from BrowserView: | 36 // Overridden from BrowserView: |
36 virtual void Init() OVERRIDE; | 37 virtual void Init() OVERRIDE; |
37 virtual void Close() OVERRIDE; | 38 virtual void Close() OVERRIDE; |
38 virtual void UpdateTitleBar() OVERRIDE; | 39 virtual void UpdateTitleBar() OVERRIDE; |
39 virtual bool GetSavedWindowBounds(gfx::Rect* bounds) const OVERRIDE; | 40 virtual bool GetSavedWindowBounds(gfx::Rect* bounds) const OVERRIDE; |
40 virtual void OnWindowActivationChanged(bool active) OVERRIDE; | 41 virtual void OnWindowActivationChanged(bool active) OVERRIDE; |
41 virtual bool AcceleratorPressed(const views::Accelerator& accelerator) | 42 virtual bool AcceleratorPressed(const views::Accelerator& accelerator) |
42 OVERRIDE; | 43 OVERRIDE; |
43 | 44 |
44 PanelBrowserFrameView* GetFrameView() const; | 45 PanelBrowserFrameView* GetFrameView() const; |
45 bool EndDragging(bool cancelled); | 46 bool EndDragging(bool cancelled); |
46 | 47 |
47 Panel* panel_; | 48 Panel* panel_; |
48 | 49 |
49 // Is the mouse button currently down? | 50 // Is the mouse button currently down? |
50 bool mouse_pressed_; | 51 bool mouse_pressed_; |
51 | 52 |
52 // Location the mouse was pressed at. Used to detect drag and drop. | 53 // Location the mouse was pressed at. Used to detect drag and drop. |
53 gfx::Point mouse_pressed_point_; | 54 gfx::Point mouse_pressed_point_; |
54 | 55 |
55 // Is the titlebar currently being dragged? That is, has the cursor | 56 // Is the titlebar currently being dragged? That is, has the cursor |
56 // moved more than kDragThreshold away from its starting position? | 57 // moved more than kDragThreshold away from its starting position? |
57 bool mouse_dragging_; | 58 bool mouse_dragging_; |
58 | 59 |
59 DISALLOW_COPY_AND_ASSIGN(PanelBrowserView); | 60 DISALLOW_COPY_AND_ASSIGN(PanelBrowserView); |
60 }; | 61 }; |
61 | 62 |
62 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_VIEW_H_ | 63 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_VIEW_H_ |
OLD | NEW |