[email protected] | 6b723f8 | 2010-10-05 20:14:27 | [diff] [blame] | 1 | // Copyright (c) 2010 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 | #pragma once |
| 8 | |
| 9 | #include "base/string16.h" |
| 10 | |
[email protected] | 804d6c8f | 2010-10-08 02:49:50 | [diff] [blame] | 11 | class GURL; |
| 12 | |
[email protected] | 6b723f8 | 2010-10-05 20:14:27 | [diff] [blame] | 13 | namespace gfx { |
| 14 | class Rect; |
| 15 | } |
| 16 | |
| 17 | class InstantLoader; |
| 18 | |
| 19 | // InstantLoader's delegate. This interface is implemented by InstantController. |
| 20 | class InstantLoaderDelegate { |
| 21 | public: |
| 22 | // Invoked when the loader is ready to be shown. |
| 23 | virtual void ShowInstantLoader(InstantLoader* loader) = 0; |
| 24 | |
| 25 | // Invoked when the loader has suggested text. |
| 26 | virtual void SetSuggestedTextFor(InstantLoader* loader, |
| 27 | const string16& text) = 0; |
| 28 | |
| 29 | // Returns the bounds of instant. |
| 30 | virtual gfx::Rect GetInstantBounds() = 0; |
| 31 | |
| 32 | // Returns true if instant should be committed on mouse up. |
| 33 | virtual bool ShouldCommitInstantOnMouseUp() = 0; |
| 34 | |
| 35 | // Invoked when the the loader should be committed. |
| 36 | virtual void CommitInstantLoader(InstantLoader* loader) = 0; |
| 37 | |
[email protected] | 0a38747 | 2010-10-07 00:18:20 | [diff] [blame] | 38 | // Invoked if the loader was created with the intention that the site supports |
[email protected] | 4c1b035d | 2010-12-10 02:32:23 | [diff] [blame] | 39 | // instant, but it turned out the site doesn't support instant. |
| 40 | virtual void InstantLoaderDoesntSupportInstant(InstantLoader* loader) = 0; |
[email protected] | 0a38747 | 2010-10-07 00:18:20 | [diff] [blame] | 41 | |
[email protected] | f38adeeb | 2010-12-08 01:08:11 | [diff] [blame] | 42 | // Adds the specified url to the set of urls instant won't prefetch for. |
| 43 | virtual void AddToBlacklist(InstantLoader* loader, const GURL& url) = 0; |
| 44 | |
[email protected] | 6b723f8 | 2010-10-05 20:14:27 | [diff] [blame] | 45 | protected: |
| 46 | virtual ~InstantLoaderDelegate() {} |
| 47 | }; |
| 48 | |
| 49 | #endif // CHROME_BROWSER_INSTANT_INSTANT_LOADER_DELEGATE_H_ |