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

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

Issue 10910232: SearchViewController needs more tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 (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_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 "ui/views/view.h" 8 #include "ui/views/view.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 12 matching lines...) Expand all
23 // Internal class name 23 // Internal class name
24 static const char kViewClassName[]; 24 static const char kViewClassName[];
25 25
26 explicit ContentsContainer(views::WebView* active); 26 explicit ContentsContainer(views::WebView* active);
27 virtual ~ContentsContainer(); 27 virtual ~ContentsContainer();
28 28
29 // Sets the active web view first in stacking order. This view is deactivated 29 // Sets the active web view first in stacking order. This view is deactivated
30 // when the |SearchViewController| is displaying the NTP, and activated 30 // when the |SearchViewController| is displaying the NTP, and activated
31 // otherwise. Deactivation removes the active view from the view hierarchy. 31 // otherwise. Deactivation removes the active view from the view hierarchy.
32 void SetActive(views::WebView* active); 32 void SetActive(views::WebView* active);
33 views::WebView* active() { return active_; } 33 views::WebView* active() const { return active_; }
34 34
35 // Sets the overlay. The overlay is sized to the bounds of this view. 35 // Sets the overlay. The overlay is sized to the bounds of this view.
36 void SetOverlay(views::View* overlay); 36 void SetOverlay(views::View* overlay);
37 views::View* overlay() { return overlay_; } 37 views::View* overlay() const { return overlay_; }
38 38
39 // Makes the preview view the active view and nulls out the old active view. 39 // Makes the preview view the active view and nulls out the old active view.
40 // It's assumed the caller will delete or remove the old active view 40 // It's assumed the caller will delete or remove the old active view
41 // separately. 41 // separately.
42 void MakePreviewContentsActiveContents(); 42 void MakePreviewContentsActiveContents();
43 43
44 // Sets the preview view. This does not delete the old. 44 // Sets the preview view. This does not delete the old.
45 void SetPreview(views::WebView* preview, 45 void SetPreview(views::WebView* preview,
46 content::WebContents* preview_web_contents); 46 content::WebContents* preview_web_contents);
47 47 views::WebView* preview() const { return preview_; }
48 content::WebContents* preview_web_contents() const { 48 content::WebContents* preview_web_contents() const {
49 return preview_web_contents_; 49 return preview_web_contents_;
50 } 50 }
51 51
52 // Sets the active top margin. 52 // Sets the active top margin.
53 void SetActiveTopMargin(int margin); 53 void SetActiveTopMargin(int margin);
54 54
55 // Returns the bounds of the preview. If the preview isn't active this 55 // Returns the bounds of the preview. If the preview isn't active this
56 // retuns the bounds the preview would be shown at. 56 // retuns the bounds the preview would be shown at.
57 gfx::Rect GetPreviewBounds(); 57 gfx::Rect GetPreviewBounds();
58 58
59 // View overrides: 59 // View overrides:
60 virtual void Layout() OVERRIDE; 60 virtual void Layout() OVERRIDE;
61 virtual std::string GetClassName() const OVERRIDE; 61 virtual std::string GetClassName() const OVERRIDE;
62 62
63 private: 63 private:
64 views::WebView* active_; 64 views::WebView* active_;
65 views::View* overlay_; 65 views::View* overlay_;
66 views::WebView* preview_; 66 views::WebView* preview_;
67 content::WebContents* preview_web_contents_; 67 content::WebContents* preview_web_contents_;
68 68
69 // The margin between the top and the active view. This is used to make the 69 // The margin between the top and the active view. This is used to make the
70 // preview overlap the bookmark bar on the new tab page. 70 // preview overlap the bookmark bar on the new tab page.
71 int active_top_margin_; 71 int active_top_margin_;
72 72
73 DISALLOW_COPY_AND_ASSIGN(ContentsContainer); 73 DISALLOW_COPY_AND_ASSIGN(ContentsContainer);
74 }; 74 };
75 75
76 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_ 76 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698