| 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_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 26 matching lines...) Expand all Loading... |
| 37 views::View* overlay() { return overlay_; } | 37 views::View* overlay() { 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() { 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_ |
| OLD | NEW |