| 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_INSTANT_INSTANT_LOADER_H_ | 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_LOADER_H_ |
| 6 #define CHROME_BROWSER_INSTANT_INSTANT_LOADER_H_ | 6 #define CHROME_BROWSER_INSTANT_INSTANT_LOADER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/string16.h" | 14 #include "base/string16.h" |
| 15 #include "chrome/browser/instant/instant_commit_type.h" | 15 #include "chrome/browser/instant/instant_commit_type.h" |
| 16 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
| 17 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 18 | 18 |
| 19 struct InstantAutocompleteResult; | 19 struct InstantAutocompleteResult; |
| 20 class InstantLoaderDelegate; | 20 class InstantLoaderDelegate; |
| 21 class TabContents; | 21 class TabContents; |
| 22 | 22 |
| 23 namespace content { | 23 namespace content { |
| 24 class NotificationDetails; | 24 class NotificationDetails; |
| 25 class NotificationSource; | 25 class NotificationSource; |
| 26 class WebContents; |
| 26 } | 27 } |
| 27 | 28 |
| 28 namespace gfx { | 29 namespace gfx { |
| 29 class Rect; | 30 class Rect; |
| 30 } | 31 } |
| 31 | 32 |
| 32 namespace history { | 33 namespace history { |
| 33 class HistoryAddPageArgs; | 34 class HistoryAddPageArgs; |
| 34 } | 35 } |
| 35 | 36 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // content::NotificationObserver: | 107 // content::NotificationObserver: |
| 107 virtual void Observe(int type, | 108 virtual void Observe(int type, |
| 108 const content::NotificationSource& source, | 109 const content::NotificationSource& source, |
| 109 const content::NotificationDetails& details) OVERRIDE; | 110 const content::NotificationDetails& details) OVERRIDE; |
| 110 | 111 |
| 111 private: | 112 private: |
| 112 class WebContentsDelegateImpl; | 113 class WebContentsDelegateImpl; |
| 113 | 114 |
| 114 void SetupPreviewContents(); | 115 void SetupPreviewContents(); |
| 115 void CleanupPreviewContents(); | 116 void CleanupPreviewContents(); |
| 116 void ReplacePreviewContents(TabContents* old_tc, TabContents* new_tc); | 117 void ReplacePreviewContents(content::WebContents* old_contents, |
| 118 content::WebContents* new_contents); |
| 117 | 119 |
| 118 InstantLoaderDelegate* const loader_delegate_; | 120 InstantLoaderDelegate* const loader_delegate_; |
| 119 | 121 |
| 120 // See comments on the getter above. | 122 // See comments on the getter above. |
| 121 scoped_ptr<TabContents> preview_contents_; | 123 scoped_ptr<TabContents> preview_contents_; |
| 122 | 124 |
| 123 // Delegate of the preview WebContents. Used to detect when the user does some | 125 // Delegate of the preview WebContents. Used to detect when the user does some |
| 124 // gesture on the WebContents and the preview needs to be activated. | 126 // gesture on the WebContents and the preview needs to be activated. |
| 125 scoped_ptr<WebContentsDelegateImpl> preview_delegate_; | 127 scoped_ptr<WebContentsDelegateImpl> preview_delegate_; |
| 126 | 128 |
| 127 // See comments on the getter above. | 129 // See comments on the getter above. |
| 128 bool supports_instant_; | 130 bool supports_instant_; |
| 129 | 131 |
| 130 // See comments on the getter above. | 132 // See comments on the getter above. |
| 131 const std::string instant_url_; | 133 const std::string instant_url_; |
| 132 | 134 |
| 133 // Used to get notifications about renderers coming and going. | 135 // Used to get notifications about renderers coming and going. |
| 134 content::NotificationRegistrar registrar_; | 136 content::NotificationRegistrar registrar_; |
| 135 | 137 |
| 136 // See comments on the getter above. | 138 // See comments on the getter above. |
| 137 scoped_refptr<history::HistoryAddPageArgs> last_navigation_; | 139 scoped_refptr<history::HistoryAddPageArgs> last_navigation_; |
| 138 | 140 |
| 139 DISALLOW_COPY_AND_ASSIGN(InstantLoader); | 141 DISALLOW_COPY_AND_ASSIGN(InstantLoader); |
| 140 }; | 142 }; |
| 141 | 143 |
| 142 #endif // CHROME_BROWSER_INSTANT_INSTANT_LOADER_H_ | 144 #endif // CHROME_BROWSER_INSTANT_INSTANT_LOADER_H_ |
| OLD | NEW |