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