| 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 "chrome/common/instant_types.h" |
| 8 #include "ui/views/view.h" | 9 #include "ui/views/view.h" |
| 9 | 10 |
| 10 namespace content { | 11 namespace content { |
| 11 class WebContents; | 12 class WebContents; |
| 12 } | 13 } |
| 13 | 14 |
| 14 namespace views { | 15 namespace views { |
| 15 class WebView; | 16 class WebView; |
| 16 } | 17 } |
| 17 | 18 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 36 void SetOverlay(views::View* overlay); | 37 void SetOverlay(views::View* overlay); |
| 37 views::View* overlay() { return overlay_; } | 38 views::View* overlay() { return overlay_; } |
| 38 | 39 |
| 39 // Makes the preview view the active view and nulls out the old active view. | 40 // 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 | 41 // It's assumed the caller will delete or remove the old active view |
| 41 // separately. | 42 // separately. |
| 42 void MakePreviewContentsActiveContents(); | 43 void MakePreviewContentsActiveContents(); |
| 43 | 44 |
| 44 // Sets the preview view. This does not delete the old. | 45 // Sets the preview view. This does not delete the old. |
| 45 void SetPreview(views::WebView* preview, | 46 void SetPreview(views::WebView* preview, |
| 46 content::WebContents* preview_web_contents); | 47 content::WebContents* preview_web_contents, |
| 48 int height, |
| 49 InstantSizeUnits units); |
| 47 views::WebView* preview() { return preview_; } | 50 views::WebView* preview() { return preview_; } |
| 51 |
| 48 content::WebContents* preview_web_contents() const { | 52 content::WebContents* preview_web_contents() const { |
| 49 return preview_web_contents_; | 53 return preview_web_contents_; |
| 50 } | 54 } |
| 51 | 55 |
| 52 // Sets the active top margin. | 56 // Sets the active top margin. |
| 53 void SetActiveTopMargin(int margin); | 57 void SetActiveTopMargin(int margin); |
| 54 | 58 |
| 55 // Returns the bounds of the preview. If the preview isn't active this | 59 // Returns the bounds of the preview. If the preview isn't active this |
| 56 // retuns the bounds the preview would be shown at. | 60 // retuns the bounds the preview would be shown at. |
| 57 gfx::Rect GetPreviewBounds(); | 61 gfx::Rect GetPreviewBounds(); |
| 58 | 62 |
| 59 // View overrides: | 63 // View overrides: |
| 60 virtual void Layout() OVERRIDE; | 64 virtual void Layout() OVERRIDE; |
| 61 virtual std::string GetClassName() const OVERRIDE; | 65 virtual std::string GetClassName() const OVERRIDE; |
| 62 | 66 |
| 63 private: | 67 private: |
| 64 views::WebView* active_; | 68 views::WebView* active_; |
| 65 views::View* overlay_; | 69 views::View* overlay_; |
| 66 views::WebView* preview_; | 70 views::WebView* preview_; |
| 67 content::WebContents* preview_web_contents_; | 71 content::WebContents* preview_web_contents_; |
| 68 | 72 |
| 73 // Returns |preview_height_| in pixels. |
| 74 int PreviewHeightInPixels() const; |
| 75 |
| 69 // The margin between the top and the active view. This is used to make the | 76 // 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. | 77 // preview overlap the bookmark bar on the new tab page. |
| 71 int active_top_margin_; | 78 int active_top_margin_; |
| 72 | 79 |
| 80 // The desired height of the preview and units. |
| 81 int preview_height_; |
| 82 InstantSizeUnits preview_height_units_; |
| 83 |
| 73 DISALLOW_COPY_AND_ASSIGN(ContentsContainer); | 84 DISALLOW_COPY_AND_ASSIGN(ContentsContainer); |
| 74 }; | 85 }; |
| 75 | 86 |
| 76 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_ | 87 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_ |
| OLD | NEW |