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_FRAME_BROWSER_ROOT_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_ROOT_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_ROOT_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_ROOT_VIEW_H_ |
7 | 7 |
8 #include "ui/views/widget/root_view.h" | 8 #include "ui/views/widget/root_view.h" |
9 | 9 |
10 class BrowserView; | 10 class BrowserView; |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 // You must call set_tabstrip before this class will accept drops. | 27 // You must call set_tabstrip before this class will accept drops. |
28 BrowserRootView(BrowserView* browser_view, views::Widget* widget); | 28 BrowserRootView(BrowserView* browser_view, views::Widget* widget); |
29 | 29 |
30 // Overridden from views::View: | 30 // Overridden from views::View: |
31 virtual bool GetDropFormats( | 31 virtual bool GetDropFormats( |
32 int* formats, | 32 int* formats, |
33 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) OVERRIDE; | 33 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) OVERRIDE; |
34 virtual bool AreDropTypesRequired() OVERRIDE; | 34 virtual bool AreDropTypesRequired() OVERRIDE; |
35 virtual bool CanDrop(const ui::OSExchangeData& data) OVERRIDE; | 35 virtual bool CanDrop(const ui::OSExchangeData& data) OVERRIDE; |
36 virtual void OnDragEntered(const views::DropTargetEvent& event) OVERRIDE; | 36 virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE; |
37 virtual int OnDragUpdated(const views::DropTargetEvent& event) OVERRIDE; | 37 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; |
38 virtual void OnDragExited() OVERRIDE; | 38 virtual void OnDragExited() OVERRIDE; |
39 virtual int OnPerformDrop(const views::DropTargetEvent& event) OVERRIDE; | 39 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; |
40 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 40 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
41 virtual std::string GetClassName() const OVERRIDE; | 41 virtual std::string GetClassName() const OVERRIDE; |
42 | 42 |
43 private: | 43 private: |
44 // Returns true if the event should be forwarded to the tabstrip. | 44 // Returns true if the event should be forwarded to the tabstrip. |
45 bool ShouldForwardToTabStrip(const views::DropTargetEvent& event); | 45 bool ShouldForwardToTabStrip(const ui::DropTargetEvent& event); |
46 | 46 |
47 // Converts the event from the hosts coordinate system to the tabstrips | 47 // Converts the event from the hosts coordinate system to the tabstrips |
48 // coordinate system. | 48 // coordinate system. |
49 views::DropTargetEvent* MapEventToTabStrip( | 49 ui::DropTargetEvent* MapEventToTabStrip( |
50 const views::DropTargetEvent& event, | 50 const ui::DropTargetEvent& event, |
51 const ui::OSExchangeData& data); | 51 const ui::OSExchangeData& data); |
52 | 52 |
53 inline TabStrip* tabstrip() const; | 53 inline TabStrip* tabstrip() const; |
54 | 54 |
55 // Returns true if |data| has string contents and the user can "paste and go". | 55 // Returns true if |data| has string contents and the user can "paste and go". |
56 // If |url| is non-NULL and the user can "paste and go", |url| is set to the | 56 // If |url| is non-NULL and the user can "paste and go", |url| is set to the |
57 // desired destination. | 57 // desired destination. |
58 bool GetPasteAndGoURL(const ui::OSExchangeData& data, GURL* url); | 58 bool GetPasteAndGoURL(const ui::OSExchangeData& data, GURL* url); |
59 | 59 |
60 // The BrowserView. | 60 // The BrowserView. |
61 BrowserView* browser_view_; | 61 BrowserView* browser_view_; |
62 | 62 |
63 // If true, drag and drop events are being forwarded to the tab strip. | 63 // If true, drag and drop events are being forwarded to the tab strip. |
64 // This is used to determine when to send OnDragEntered and OnDragExited | 64 // This is used to determine when to send OnDragEntered and OnDragExited |
65 // to the tab strip. | 65 // to the tab strip. |
66 bool forwarding_to_tab_strip_; | 66 bool forwarding_to_tab_strip_; |
67 | 67 |
68 DISALLOW_COPY_AND_ASSIGN(BrowserRootView); | 68 DISALLOW_COPY_AND_ASSIGN(BrowserRootView); |
69 }; | 69 }; |
70 | 70 |
71 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_ROOT_VIEW_H_ | 71 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_ROOT_VIEW_H_ |
OLD | NEW |