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