Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / search / instant_ipc_sender.h
blob95e183dc38585d2d102f202a453d5d00509d9969
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"
12 namespace gfx {
13 class Rect;
16 namespace IPC {
17 class Sender;
20 class InstantIPCSender : public content::WebContentsObserver {
21 public:
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) {}
43 protected:
44 InstantIPCSender() {}
46 private:
47 DISALLOW_COPY_AND_ASSIGN(InstantIPCSender);
50 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_IPC_SENDER_H_