| 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_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_LOADER_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_INSTANT_INSTANT_LOADER_DELEGATE_H_ | 6 #define CHROME_BROWSER_INSTANT_INSTANT_LOADER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/string16.h" | |
| 11 #include "chrome/common/instant_types.h" | 10 #include "chrome/common/instant_types.h" |
| 12 | 11 |
| 13 class InstantLoader; | 12 class InstantLoader; |
| 14 | 13 |
| 15 // InstantLoader calls these methods on its delegate (InstantController) | 14 // InstantLoader calls these methods on its delegate (InstantController) |
| 16 // to notify it of interesting events happening on the Instant preview. | 15 // to notify it of interesting events happening on the Instant preview. |
| 17 class InstantLoaderDelegate { | 16 class InstantLoaderDelegate { |
| 18 public: | 17 public: |
| 19 // Invoked when the loader has suggested text. | 18 // Invoked when the loader has suggested text. |
| 20 virtual void SetSuggestions( | 19 virtual void SetSuggestions( |
| 21 InstantLoader* loader, | 20 InstantLoader* loader, |
| 22 const std::vector<string16>& suggestions, | 21 const std::vector<InstantSuggestion>& suggestions) = 0; |
| 23 InstantCompleteBehavior behavior) = 0; | |
| 24 | 22 |
| 25 // Commit the preview. | 23 // Commit the preview. |
| 26 virtual void CommitInstantLoader(InstantLoader* loader) = 0; | 24 virtual void CommitInstantLoader(InstantLoader* loader) = 0; |
| 27 | 25 |
| 28 // Notification that the first page load (of the Instant URL) completed. | 26 // Notification that the first page load (of the Instant URL) completed. |
| 29 virtual void InstantLoaderPreviewLoaded(InstantLoader* loader) = 0; | 27 virtual void InstantLoaderPreviewLoaded(InstantLoader* loader) = 0; |
| 30 | 28 |
| 31 // Notification when the loader has determined whether or not the page | 29 // Notification when the loader has determined whether or not the page |
| 32 // supports the Instant API. | 30 // supports the Instant API. |
| 33 virtual void InstantSupportDetermined(InstantLoader* loader, | 31 virtual void InstantSupportDetermined(InstantLoader* loader, |
| 34 bool supports_instant) = 0; | 32 bool supports_instant) = 0; |
| 35 | 33 |
| 36 // Notification that the loader swapped a different TabContents into the | 34 // Notification that the loader swapped a different TabContents into the |
| 37 // preview, usually because a prerendered page was navigated to. | 35 // preview, usually because a prerendered page was navigated to. |
| 38 virtual void SwappedTabContents(InstantLoader* loader) = 0; | 36 virtual void SwappedTabContents(InstantLoader* loader) = 0; |
| 39 | 37 |
| 40 // Notification that the preview gained focus, usually due to the user | 38 // Notification that the preview gained focus, usually due to the user |
| 41 // clicking on it. | 39 // clicking on it. |
| 42 virtual void InstantLoaderContentsFocused(InstantLoader* loader) = 0; | 40 virtual void InstantLoaderContentsFocused(InstantLoader* loader) = 0; |
| 43 | 41 |
| 44 protected: | 42 protected: |
| 45 virtual ~InstantLoaderDelegate() {} | 43 virtual ~InstantLoaderDelegate() {} |
| 46 }; | 44 }; |
| 47 | 45 |
| 48 #endif // CHROME_BROWSER_INSTANT_INSTANT_LOADER_DELEGATE_H_ | 46 #endif // CHROME_BROWSER_INSTANT_INSTANT_LOADER_DELEGATE_H_ |
| OLD | NEW |