1 // Copyright 2013 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 #ifndef CHROME_BROWSER_UI_SEARCH_INSTANT_IPC_SENDER_H_
6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_IPC_SENDER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/common/omnibox_focus_state.h"
10 #include "content/public/browser/web_contents_observer.h"
20 class InstantIPCSender
: public content::WebContentsObserver
{
22 // Creates a new instance of InstantIPCSender. If |is_incognito| is true,
23 // the instance will only send appropriate IPCs for incognito profiles.
24 static scoped_ptr
<InstantIPCSender
> Create(bool is_incognito
);
26 virtual ~InstantIPCSender() {}
28 // Sets |web_contents| as the receiver of IPCs.
29 void SetContents(content::WebContents
* web_contents
);
32 // Tells the page the left and right margins of the omnibox. This is used by
33 // the page to align text or assets properly with the omnibox.
34 virtual void SetOmniboxBounds(const gfx::Rect
& bounds
) {}
36 // Tells the page that the omnibox focus has changed.
37 virtual void FocusChanged(OmniboxFocusState state
,
38 OmniboxFocusChangeReason reason
) {}
40 // Tells the page that user input started or stopped.
41 virtual void SetInputInProgress(bool input_in_progress
) {}
47 DISALLOW_COPY_AND_ASSIGN(InstantIPCSender
);
50 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_IPC_SENDER_H_