Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Side by Side Diff: chrome/browser/ui/views/frame/contents_container.h

Issue 13974003: alternate ntp: fix content origin when overlay shrinks to shorter than top bars (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed scott's comment Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 ContentsContainer(views::WebView* active, views::View* browser_view);
36 virtual ~ContentsContainer(); 36 virtual ~ContentsContainer();
37 37
38 // Makes the overlay view the active view and nulls out the old active view. 38 // 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. 39 // The caller must delete or remove the old active view separately.
40 void MakeOverlayContentsActiveContents(); 40 void MakeOverlayContentsActiveContents();
41 41
42 // Sets the overlay view. This does not delete the old. 42 // Sets the overlay view. This does not delete the old.
43 void SetOverlay(views::WebView* overlay, 43 void SetOverlay(views::WebView* overlay,
44 content::WebContents* overlay_web_contents, 44 content::WebContents* overlay_web_contents,
45 int height, 45 int height,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // Overridden from views::View: 79 // Overridden from views::View:
80 virtual void Layout() OVERRIDE; 80 virtual void Layout() OVERRIDE;
81 virtual std::string GetClassName() const OVERRIDE; 81 virtual std::string GetClassName() const OVERRIDE;
82 82
83 // content::NotificationObserver implementation. 83 // content::NotificationObserver implementation.
84 virtual void Observe(int type, 84 virtual void Observe(int type,
85 const content::NotificationSource& source, 85 const content::NotificationSource& source,
86 const content::NotificationDetails& details) OVERRIDE; 86 const content::NotificationDetails& details) OVERRIDE;
87 87
88 views::WebView* active_; 88 views::WebView* active_;
89 views::View* browser_view_;
89 views::WebView* overlay_; 90 views::WebView* overlay_;
90 scoped_ptr<views::View> shadow_view_; 91 scoped_ptr<views::View> shadow_view_;
91 content::WebContents* overlay_web_contents_; 92 content::WebContents* overlay_web_contents_;
92 bool draw_drop_shadow_; 93 bool draw_drop_shadow_;
93 94
94 // The margin between the top and the active view. This is used to make the 95 // 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. 96 // overlay overlap the bookmark bar on the new tab page.
96 int active_top_margin_; 97 int active_top_margin_;
97 98
98 // The desired height of the overlay and units. 99 // The desired height of the overlay and units.
99 int overlay_height_; 100 int overlay_height_;
100 InstantSizeUnits overlay_height_units_; 101 InstantSizeUnits overlay_height_units_;
101 102
102 content::NotificationRegistrar registrar_; 103 content::NotificationRegistrar registrar_;
103 104
104 DISALLOW_COPY_AND_ASSIGN(ContentsContainer); 105 DISALLOW_COPY_AND_ASSIGN(ContentsContainer);
105 }; 106 };
106 107
107 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_ 108 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view_layout.cc ('k') | chrome/browser/ui/views/frame/contents_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698