| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SYNC_GLUE_SYNCED_TAB_DELEGATE_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNCED_TAB_DELEGATE_ANDROID_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_SYNCED_TAB_DELEGATE_ANDROID_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_SYNCED_TAB_DELEGATE_ANDROID_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "chrome/browser/sync/glue/synced_tab_delegate.h" | 9 #include "chrome/browser/sync/glue/synced_tab_delegate.h" |
| 10 #include "content/public/browser/web_contents_user_data.h" | 10 #include "content/public/browser/web_contents_user_data.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 class WebContents; | 13 class WebContents; |
| 14 } | 14 } |
| 15 | 15 |
| 16 class TabAndroid; | 16 class TabAndroid; |
| 17 class TabContentsSyncedTabDelegate; |
| 18 |
| 17 namespace browser_sync { | 19 namespace browser_sync { |
| 18 // On Android a tab can exist even without web contents. | 20 // On Android a tab can exist even without web contents. |
| 19 | 21 |
| 20 // SyncedTabDelegateAndroid wraps TabContentsSyncedTabDelegate and provides | 22 // SyncedTabDelegateAndroid wraps TabContentsSyncedTabDelegate and provides |
| 21 // a method to set web contents later when tab is brought to memory. | 23 // a method to set web contents later when tab is brought to memory. |
| 22 class SyncedTabDelegateAndroid : public browser_sync::SyncedTabDelegate { | 24 class SyncedTabDelegateAndroid : public browser_sync::SyncedTabDelegate { |
| 23 public: | 25 public: |
| 24 explicit SyncedTabDelegateAndroid(TabAndroid* owning_tab_); | 26 explicit SyncedTabDelegateAndroid(TabAndroid* owning_tab_); |
| 25 ~SyncedTabDelegateAndroid() override; | 27 ~SyncedTabDelegateAndroid() override; |
| 26 | 28 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 50 | 52 |
| 51 // Set the web contents for this tab. Also creates | 53 // Set the web contents for this tab. Also creates |
| 52 // TabContentsSyncedTabDelegate for this tab. | 54 // TabContentsSyncedTabDelegate for this tab. |
| 53 virtual void SetWebContents(content::WebContents* web_contents); | 55 virtual void SetWebContents(content::WebContents* web_contents); |
| 54 // Set web contents to null. | 56 // Set web contents to null. |
| 55 virtual void ResetWebContents(); | 57 virtual void ResetWebContents(); |
| 56 | 58 |
| 57 private: | 59 private: |
| 58 content::WebContents* web_contents_; | 60 content::WebContents* web_contents_; |
| 59 TabAndroid* tab_android_; | 61 TabAndroid* tab_android_; |
| 62 TabContentsSyncedTabDelegate* tab_contents_delegate_; |
| 60 | 63 |
| 61 DISALLOW_COPY_AND_ASSIGN(SyncedTabDelegateAndroid); | 64 DISALLOW_COPY_AND_ASSIGN(SyncedTabDelegateAndroid); |
| 62 }; | 65 }; |
| 63 } // namespace browser_sync | 66 } // namespace browser_sync |
| 64 | 67 |
| 65 #endif // CHROME_BROWSER_SYNC_GLUE_SYNCED_TAB_DELEGATE_ANDROID_H_ | 68 #endif // CHROME_BROWSER_SYNC_GLUE_SYNCED_TAB_DELEGATE_ANDROID_H_ |
| OLD | NEW |