Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / omnibox / omnibox_popup_view.h
blob42d27c63d244f27fc87a4547437cd1cbc78e1c07
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
3 // found in the LICENSE file.
5 // This file defines the interface class OmniboxPopupView. Each toolkit
6 // will implement the popup view differently, so that code is inheriently
7 // platform specific. However, the OmniboxPopupModel needs to do some
8 // communication with the view. Since the model is shared between platforms,
9 // we need to define an interface that all view implementations will share.
11 #ifndef CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_POPUP_VIEW_H_
12 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_POPUP_VIEW_H_
14 #include "build/build_config.h"
16 namespace gfx {
17 class Rect;
20 class OmniboxPopupView {
21 public:
22 virtual ~OmniboxPopupView() {}
24 // Returns true if the popup is currently open.
25 virtual bool IsOpen() const = 0;
27 // Invalidates one line of the autocomplete popup.
28 virtual void InvalidateLine(size_t line) = 0;
30 // Redraws the popup window to match any changes in the result set; this may
31 // mean opening or closing the window.
32 virtual void UpdatePopupAppearance() = 0;
34 // Returns the target bounds for the popup. This returns the popup's current
35 // bounds when not animating, or the desired target bounds when animating.
36 // The return value is in screen coordinates.
37 virtual gfx::Rect GetTargetBounds() = 0;
39 // Paint any pending updates.
40 virtual void PaintUpdatesNow() = 0;
42 // This method is called when the view should cancel any active drag (e.g.
43 // because the user pressed ESC). The view may or may not need to take any
44 // action (e.g. releasing mouse capture). Note that this can be called when
45 // no drag is in progress.
46 virtual void OnDragCanceled() = 0;
49 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_POPUP_VIEW_H_