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