OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_CONTENTS_CONTAINER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 14 matching lines...) Expand all Loading... | |
25 | 25 |
26 // ContentsContainer is responsible for managing the WebContents views. | 26 // ContentsContainer is responsible for managing the WebContents views. |
27 // ContentsContainer has up to two children: one for the currently active | 27 // ContentsContainer has up to two children: one for the currently active |
28 // WebContents and one for Instant's WebContents. | 28 // WebContents and one for Instant's WebContents. |
29 class ContentsContainer : public views::View, | 29 class ContentsContainer : public views::View, |
30 public content::NotificationObserver { | 30 public content::NotificationObserver { |
31 public: | 31 public: |
32 // Internal class name | 32 // Internal class name |
33 static const char kViewClassName[]; | 33 static const char kViewClassName[]; |
34 | 34 |
35 explicit ContentsContainer(views::WebView* active); | 35 explicit ContentsContainer(views::WebView* active, |
sky
2013/04/15 23:39:57
no explicit.
kuan
2013/04/15 23:45:38
Done.
| |
36 views::View* browser_view); | |
36 virtual ~ContentsContainer(); | 37 virtual ~ContentsContainer(); |
37 | 38 |
38 // Makes the overlay view the active view and nulls out the old active view. | 39 // Makes the overlay view the active view and nulls out the old active view. |
39 // The caller must delete or remove the old active view separately. | 40 // The caller must delete or remove the old active view separately. |
40 void MakeOverlayContentsActiveContents(); | 41 void MakeOverlayContentsActiveContents(); |
41 | 42 |
42 // Sets the overlay view. This does not delete the old. | 43 // Sets the overlay view. This does not delete the old. |
43 void SetOverlay(views::WebView* overlay, | 44 void SetOverlay(views::WebView* overlay, |
44 content::WebContents* overlay_web_contents, | 45 content::WebContents* overlay_web_contents, |
45 int height, | 46 int height, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 // Overridden from views::View: | 80 // Overridden from views::View: |
80 virtual void Layout() OVERRIDE; | 81 virtual void Layout() OVERRIDE; |
81 virtual std::string GetClassName() const OVERRIDE; | 82 virtual std::string GetClassName() const OVERRIDE; |
82 | 83 |
83 // content::NotificationObserver implementation. | 84 // content::NotificationObserver implementation. |
84 virtual void Observe(int type, | 85 virtual void Observe(int type, |
85 const content::NotificationSource& source, | 86 const content::NotificationSource& source, |
86 const content::NotificationDetails& details) OVERRIDE; | 87 const content::NotificationDetails& details) OVERRIDE; |
87 | 88 |
88 views::WebView* active_; | 89 views::WebView* active_; |
90 views::View* browser_view_; | |
89 views::WebView* overlay_; | 91 views::WebView* overlay_; |
90 scoped_ptr<views::View> shadow_view_; | 92 scoped_ptr<views::View> shadow_view_; |
91 content::WebContents* overlay_web_contents_; | 93 content::WebContents* overlay_web_contents_; |
92 bool draw_drop_shadow_; | 94 bool draw_drop_shadow_; |
93 | 95 |
94 // The margin between the top and the active view. This is used to make the | 96 // The margin between the top and the active view. This is used to make the |
95 // overlay overlap the bookmark bar on the new tab page. | 97 // overlay overlap the bookmark bar on the new tab page. |
96 int active_top_margin_; | 98 int active_top_margin_; |
97 | 99 |
98 // The desired height of the overlay and units. | 100 // The desired height of the overlay and units. |
99 int overlay_height_; | 101 int overlay_height_; |
100 InstantSizeUnits overlay_height_units_; | 102 InstantSizeUnits overlay_height_units_; |
101 | 103 |
102 content::NotificationRegistrar registrar_; | 104 content::NotificationRegistrar registrar_; |
103 | 105 |
104 DISALLOW_COPY_AND_ASSIGN(ContentsContainer); | 106 DISALLOW_COPY_AND_ASSIGN(ContentsContainer); |
105 }; | 107 }; |
106 | 108 |
107 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_ | 109 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_ |
OLD | NEW |