| 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_TAB_CONTENTS_TAB_CONTENTS_CONTAINER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_TAB_CONTENTS_CONTAINER_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_TAB_CONTENTS_CONTAINER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_TAB_CONTENTS_CONTAINER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_container.h" | 9 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_container.h" |
| 10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
| 11 #include "content/public/browser/notification_registrar.h" | 11 #include "content/public/browser/notification_registrar.h" |
| 12 #include "ui/views/view.h" | 12 #include "ui/views/view.h" |
| 13 | 13 |
| 14 class NativeTabContentsContainer; | 14 class NativeTabContentsContainer; |
| 15 class RenderViewHost; | |
| 16 | 15 |
| 17 namespace content { | 16 namespace content { |
| 17 class RenderViewHost; |
| 18 class WebContents; | 18 class WebContents; |
| 19 } | 19 } |
| 20 | 20 |
| 21 class TabContentsContainer : public views::View, | 21 class TabContentsContainer : public views::View, |
| 22 public content::NotificationObserver { | 22 public content::NotificationObserver { |
| 23 public: | 23 public: |
| 24 TabContentsContainer(); | 24 TabContentsContainer(); |
| 25 virtual ~TabContentsContainer(); | 25 virtual ~TabContentsContainer(); |
| 26 | 26 |
| 27 // Changes the WebContents associated with this view. | 27 // Changes the WebContents associated with this view. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 56 virtual void ViewHierarchyChanged(bool is_add, views::View* parent, | 56 virtual void ViewHierarchyChanged(bool is_add, views::View* parent, |
| 57 views::View* child) OVERRIDE; | 57 views::View* child) OVERRIDE; |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 // Add or remove observers for events that we care about. | 60 // Add or remove observers for events that we care about. |
| 61 void AddObservers(); | 61 void AddObservers(); |
| 62 void RemoveObservers(); | 62 void RemoveObservers(); |
| 63 | 63 |
| 64 // Called when the RenderViewHost of the hosted TabContents has changed, e.g. | 64 // Called when the RenderViewHost of the hosted TabContents has changed, e.g. |
| 65 // to show an interstitial page. | 65 // to show an interstitial page. |
| 66 void RenderViewHostChanged(RenderViewHost* old_host, | 66 void RenderViewHostChanged(content::RenderViewHost* old_host, |
| 67 RenderViewHost* new_host); | 67 content::RenderViewHost* new_host); |
| 68 | 68 |
| 69 // Called when a WebContents is destroyed. This gives us a chance to clean | 69 // Called when a WebContents is destroyed. This gives us a chance to clean |
| 70 // up our internal state if the TabContents is somehow destroyed before we | 70 // up our internal state if the TabContents is somehow destroyed before we |
| 71 // get notified. | 71 // get notified. |
| 72 void TabContentsDestroyed(content::WebContents* contents); | 72 void TabContentsDestroyed(content::WebContents* contents); |
| 73 | 73 |
| 74 // An instance of a NativeTabContentsContainer object that holds the native | 74 // An instance of a NativeTabContentsContainer object that holds the native |
| 75 // view handle associated with the attached TabContents. | 75 // view handle associated with the attached TabContents. |
| 76 NativeTabContentsContainer* native_container_; | 76 NativeTabContentsContainer* native_container_; |
| 77 | 77 |
| 78 // The attached WebContents. | 78 // The attached WebContents. |
| 79 content::WebContents* web_contents_; | 79 content::WebContents* web_contents_; |
| 80 | 80 |
| 81 // Handles registering for our notifications. | 81 // Handles registering for our notifications. |
| 82 content::NotificationRegistrar registrar_; | 82 content::NotificationRegistrar registrar_; |
| 83 | 83 |
| 84 // The current reserved rect in view coordinates where contents should not be | 84 // The current reserved rect in view coordinates where contents should not be |
| 85 // rendered to draw the resize corner, etc. | 85 // rendered to draw the resize corner, etc. |
| 86 // Cached here to update ever changing renderers. | 86 // Cached here to update ever changing renderers. |
| 87 gfx::Rect cached_reserved_rect_; | 87 gfx::Rect cached_reserved_rect_; |
| 88 | 88 |
| 89 DISALLOW_COPY_AND_ASSIGN(TabContentsContainer); | 89 DISALLOW_COPY_AND_ASSIGN(TabContentsContainer); |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_TAB_CONTENTS_CONTAINER_H_ | 92 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_TAB_CONTENTS_CONTAINER_H_ |
| OLD | NEW |