blob: bfe151838a40f11e21c8b771c4dd21e9e44679d5 [file] [log] [blame]
[email protected]6b723f82010-10-05 20:14:271// 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]804d6c8f2010-10-08 02:49:5011class GURL;
12
[email protected]6b723f82010-10-05 20:14:2713namespace gfx {
14class Rect;
15}
16
17class InstantLoader;
18
19// InstantLoader's delegate. This interface is implemented by InstantController.
20class 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]0a387472010-10-07 00:18:2038 // Invoked if the loader was created with the intention that the site supports
[email protected]4c1b035d2010-12-10 02:32:2339 // instant, but it turned out the site doesn't support instant.
40 virtual void InstantLoaderDoesntSupportInstant(InstantLoader* loader) = 0;
[email protected]0a387472010-10-07 00:18:2041
[email protected]f38adeeb2010-12-08 01:08:1142 // 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]6b723f82010-10-05 20:14:2745 protected:
46 virtual ~InstantLoaderDelegate() {}
47};
48
49#endif // CHROME_BROWSER_INSTANT_INSTANT_LOADER_DELEGATE_H_