| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_CONSTRAINED_WINDOW_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_CONSTRAINED_WINDOW_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_UI_CONSTRAINED_WINDOW_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_UI_CONSTRAINED_WINDOW_TAB_HELPER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <deque> | 9 #include <deque> |
| 10 | 10 |
| 11 #include "content/public/browser/web_contents_observer.h" | 11 #include "content/public/browser/web_contents_observer.h" |
| 12 | 12 |
| 13 class ConstrainedWindow; | 13 class ConstrainedWindow; |
| 14 class ConstrainedWindowTabHelperDelegate; | 14 class ConstrainedWindowTabHelperDelegate; |
| 15 class TabContents; | 15 class TabContents; |
| 16 typedef TabContents TabContentsWrapper; | |
| 17 | 16 |
| 18 // Per-tab class to manage constrained windows. | 17 // Per-tab class to manage constrained windows. |
| 19 class ConstrainedWindowTabHelper : public content::WebContentsObserver { | 18 class ConstrainedWindowTabHelper : public content::WebContentsObserver { |
| 20 public: | 19 public: |
| 21 explicit ConstrainedWindowTabHelper(TabContentsWrapper* tab_contents); | 20 explicit ConstrainedWindowTabHelper(TabContents* tab_contents); |
| 22 virtual ~ConstrainedWindowTabHelper(); | 21 virtual ~ConstrainedWindowTabHelper(); |
| 23 | 22 |
| 24 ConstrainedWindowTabHelperDelegate* delegate() const { return delegate_; } | 23 ConstrainedWindowTabHelperDelegate* delegate() const { return delegate_; } |
| 25 void set_delegate(ConstrainedWindowTabHelperDelegate* d) { delegate_ = d; } | 24 void set_delegate(ConstrainedWindowTabHelperDelegate* d) { delegate_ = d; } |
| 26 | 25 |
| 27 // Adds the given window to the list of child windows. The window will notify | 26 // Adds the given window to the list of child windows. The window will notify |
| 28 // via WillClose() when it is being destroyed. | 27 // via WillClose() when it is being destroyed. |
| 29 void AddConstrainedDialog(ConstrainedWindow* window); | 28 void AddConstrainedDialog(ConstrainedWindow* window); |
| 30 | 29 |
| 31 // Closes all constrained windows. | 30 // Closes all constrained windows. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 53 } | 52 } |
| 54 | 53 |
| 55 private: | 54 private: |
| 56 // Overridden from content::WebContentsObserver: | 55 // Overridden from content::WebContentsObserver: |
| 57 virtual void DidNavigateMainFrame( | 56 virtual void DidNavigateMainFrame( |
| 58 const content::LoadCommittedDetails& details, | 57 const content::LoadCommittedDetails& details, |
| 59 const content::FrameNavigateParams& params) OVERRIDE; | 58 const content::FrameNavigateParams& params) OVERRIDE; |
| 60 virtual void DidGetIgnoredUIEvent() OVERRIDE; | 59 virtual void DidGetIgnoredUIEvent() OVERRIDE; |
| 61 virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE; | 60 virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE; |
| 62 | 61 |
| 63 // Our owning TabContentsWrapper. | 62 // Our owning TabContents. |
| 64 TabContentsWrapper* wrapper_; | 63 TabContents* tab_contents_; |
| 65 | 64 |
| 66 // Delegate for notifying our owner about stuff. Not owned by us. | 65 // Delegate for notifying our owner about stuff. Not owned by us. |
| 67 ConstrainedWindowTabHelperDelegate* delegate_; | 66 ConstrainedWindowTabHelperDelegate* delegate_; |
| 68 | 67 |
| 69 // All active constrained windows. | 68 // All active constrained windows. |
| 70 ConstrainedWindowList child_windows_; | 69 ConstrainedWindowList child_windows_; |
| 71 | 70 |
| 72 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowTabHelper); | 71 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowTabHelper); |
| 73 }; | 72 }; |
| 74 | 73 |
| 75 #endif // CHROME_BROWSER_UI_CONSTRAINED_WINDOW_TAB_HELPER_H_ | 74 #endif // CHROME_BROWSER_UI_CONSTRAINED_WINDOW_TAB_HELPER_H_ |
| OLD | NEW |