Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(687)

Side by Side Diff: chrome/browser/instant/instant_controller_delegate.h

Issue 10915217: Hook up SetInstantPreviewHeight for ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move hidden notification, too. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/instant/instant_controller.cc ('k') | chrome/browser/instant/instant_loader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_CONTROLLER_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_DELEGATE_H_
6 #define CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_DELEGATE_H_ 6 #define CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_DELEGATE_H_
7 7
8 #include "base/string16.h" 8 #include "base/string16.h"
9 #include "chrome/common/instant_types.h" 9 #include "chrome/common/instant_types.h"
10 10
11 class TabContents; 11 class TabContents;
12 12
13 namespace gfx { 13 namespace gfx {
14 class Rect; 14 class Rect;
15 } 15 }
16 16
17 // InstantController calls these methods on its delegate (Browser, via 17 // InstantController calls these methods on its delegate (Browser, via
18 // BrowserInstantController) to ask for the Instant preview to be shown, 18 // BrowserInstantController) to ask for the Instant preview to be shown,
19 // hidden, etc. In the following methods, if a TabContents argument is 19 // hidden, etc. In the following methods, if a TabContents argument is
20 // explicitly supplied, the delegate MUST use it. Otherwise, the preview 20 // explicitly supplied, the delegate MUST use it. Otherwise, the preview
21 // TabContents can be gotten by calling InstantController::GetPreviewContents() 21 // TabContents can be gotten by calling InstantController::GetPreviewContents()
22 // (note that it may return NULL). 22 // (note that it may return NULL).
23 class InstantControllerDelegate { 23 class InstantControllerDelegate {
24 public: 24 public:
25 // Show the preview. 25 // Show the preview with the given |height|.
26 virtual void ShowInstant() = 0; 26 virtual void ShowInstant(int height, InstantSizeUnits units) = 0;
27 27
28 // Hide any preview currently being shown. 28 // Hide any preview currently being shown.
29 virtual void HideInstant() = 0; 29 virtual void HideInstant() = 0;
30 30
31 // Commit the |preview| by merging it into the active tab. Delegate takes 31 // Commit the |preview| by merging it into the active tab. Delegate takes
32 // ownership of |preview|. 32 // ownership of |preview|.
33 virtual void CommitInstant(TabContents* preview) = 0; 33 virtual void CommitInstant(TabContents* preview) = 0;
34 34
35 // Autocomplete the Instant suggested |text| into the omnibox, using the 35 // Autocomplete the Instant suggested |text| into the omnibox, using the
36 // specified |behavior| (see instant_types.h for details). 36 // specified |behavior| (see instant_types.h for details).
37 virtual void SetSuggestedText(const string16& text, 37 virtual void SetSuggestedText(const string16& text,
38 InstantCompleteBehavior behavior) = 0; 38 InstantCompleteBehavior behavior) = 0;
39 39
40 // Return the bounds that the preview is placed at, in screen coordinates. 40 // Return the bounds that the preview is placed at, in screen coordinates.
41 virtual gfx::Rect GetInstantBounds() = 0; 41 virtual gfx::Rect GetInstantBounds() = 0;
42 42
43 // Notification that the preview gained focus, usually due to the user 43 // Notification that the preview gained focus, usually due to the user
44 // clicking on it. 44 // clicking on it.
45 virtual void InstantPreviewFocused() = 0; 45 virtual void InstantPreviewFocused() = 0;
46 46
47 // Return the currently active tab, over which any preview would be shown. 47 // Return the currently active tab, over which any preview would be shown.
48 virtual TabContents* GetActiveTabContents() const = 0; 48 virtual TabContents* GetActiveTabContents() const = 0;
49 49
50 protected: 50 protected:
51 virtual ~InstantControllerDelegate() {} 51 virtual ~InstantControllerDelegate() {}
52 }; 52 };
53 53
54 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_DELEGATE_H_ 54 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_DELEGATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/instant/instant_controller.cc ('k') | chrome/browser/instant/instant_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698