blob: 726e871794f8b6bd994bbb84ce63e74dd28b5d72 (
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
50
|
// Copyright (c) 2012 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_DELEGATE_H_
#define CHROME_BROWSER_INSTANT_INSTANT_DELEGATE_H_
#pragma once
#include "base/string16.h"
#include "chrome/common/instant_types.h"
class TabContents;
namespace gfx {
class Rect;
}
// InstantController's delegate. Normally the Browser implements this. See
// InstantController for details.
class InstantDelegate {
public:
// Invoked when the instant TabContents should be shown.
virtual void ShowInstant(TabContents* preview_contents) = 0;
// Invoked when the instant TabContents should be hidden.
virtual void HideInstant() = 0;
// Invoked when the user does something that should result in the preview
// TabContents becoming the active TabContents. The delegate
// takes ownership of the supplied TabContents.
virtual void CommitInstant(TabContents* preview_contents) = 0;
// Invoked when the suggested text is to change to |text|.
virtual void SetSuggestedText(const string16& text,
InstantCompleteBehavior behavior) = 0;
// Returns the bounds instant will be placed at in screen coordinates.
virtual gfx::Rect GetInstantBounds() = 0;
// Invoked when the WebContents becomes focused.
virtual void InstantPreviewFocused() = 0;
// Returns the tab contents over which the instant preview is overlaid.
virtual TabContents* GetInstantHostTabContents() const = 0;
protected:
virtual ~InstantDelegate() {}
};
#endif // CHROME_BROWSER_INSTANT_INSTANT_DELEGATE_H_
|