| OLD | NEW |
| 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 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // Show the preview with the given |height|. | 25 // Show the preview with the given |height|. |
| 26 virtual void ShowInstant(int height, InstantSizeUnits units) = 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 or adding it as a | 31 // Commit the |preview| by merging it into the active tab or adding it as a |
| 32 // new tab, based on |in_new_tab|. Delegate takes ownership of |preview|. | 32 // new tab, based on |in_new_tab|. Delegate takes ownership of |preview|. |
| 33 virtual void CommitInstant(TabContents* preview, bool in_new_tab) = 0; | 33 virtual void CommitInstant(TabContents* preview, bool in_new_tab) = 0; |
| 34 | 34 |
| 35 // Indicates whether the search provider has a custom logo for the NTP. |
| 36 virtual void SetHasCustomLogo(bool has_logo) = 0; |
| 37 |
| 35 // Autocomplete the Instant suggested |text| into the omnibox, using the | 38 // Autocomplete the Instant suggested |text| into the omnibox, using the |
| 36 // specified |behavior| (see instant_types.h for details). | 39 // specified |behavior| (see instant_types.h for details). |
| 37 virtual void SetSuggestedText(const string16& text, | 40 virtual void SetSuggestedText(const string16& text, |
| 38 InstantCompleteBehavior behavior) = 0; | 41 InstantCompleteBehavior behavior) = 0; |
| 39 | 42 |
| 40 // Return the bounds that the preview is placed at, in screen coordinates. | 43 // Return the bounds that the preview is placed at, in screen coordinates. |
| 41 virtual gfx::Rect GetInstantBounds() = 0; | 44 virtual gfx::Rect GetInstantBounds() = 0; |
| 42 | 45 |
| 43 // Notification that the preview gained focus, usually due to the user | 46 // Notification that the preview gained focus, usually due to the user |
| 44 // clicking on it. | 47 // clicking on it. |
| 45 virtual void InstantPreviewFocused() = 0; | 48 virtual void InstantPreviewFocused() = 0; |
| 46 | 49 |
| 47 // Return the currently active tab, over which any preview would be shown. | 50 // Return the currently active tab, over which any preview would be shown. |
| 48 virtual TabContents* GetActiveTabContents() const = 0; | 51 virtual TabContents* GetActiveTabContents() const = 0; |
| 49 | 52 |
| 50 protected: | 53 protected: |
| 51 virtual ~InstantControllerDelegate() {} | 54 virtual ~InstantControllerDelegate() {} |
| 52 }; | 55 }; |
| 53 | 56 |
| 54 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_DELEGATE_H_ | 57 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_DELEGATE_H_ |
| OLD | NEW |