summaryrefslogtreecommitdiffstats
path: root/chrome/browser/instant/instant_loader_delegate.h
blob: bfe151838a40f11e21c8b771c4dd21e9e44679d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_INSTANT_INSTANT_LOADER_DELEGATE_H_
#define CHROME_BROWSER_INSTANT_INSTANT_LOADER_DELEGATE_H_
#pragma once

#include "base/string16.h"

class GURL;

namespace gfx {
class Rect;
}

class InstantLoader;

// InstantLoader's delegate. This interface is implemented by InstantController.
class InstantLoaderDelegate {
 public:
  // Invoked when the loader is ready to be shown.
  virtual void ShowInstantLoader(InstantLoader* loader) = 0;

  // Invoked when the loader has suggested text.
  virtual void SetSuggestedTextFor(InstantLoader* loader,
                                   const string16& text) = 0;

  // Returns the bounds of instant.
  virtual gfx::Rect GetInstantBounds() = 0;

  // Returns true if instant should be committed on mouse up.
  virtual bool ShouldCommitInstantOnMouseUp() = 0;

  // Invoked when the the loader should be committed.
  virtual void CommitInstantLoader(InstantLoader* loader) = 0;

  // Invoked if the loader was created with the intention that the site supports
  // instant, but it turned out the site doesn't support instant.
  virtual void InstantLoaderDoesntSupportInstant(InstantLoader* loader) = 0;

  // Adds the specified url to the set of urls instant won't prefetch for.
  virtual void AddToBlacklist(InstantLoader* loader, const GURL& url) = 0;

 protected:
  virtual ~InstantLoaderDelegate() {}
};

#endif  // CHROME_BROWSER_INSTANT_INSTANT_LOADER_DELEGATE_H_