Chromium Code Reviews| Index: chrome/browser/search_engines/search_provider_install_state_dispatcher_host.h |
| diff --git a/chrome/browser/search_engines/search_provider_install_state_dispatcher_host.h b/chrome/browser/search_engines/search_provider_install_state_dispatcher_host.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..075684d35e705d7e8bc6772716477f36b50e40d6 |
| --- /dev/null |
| +++ b/chrome/browser/search_engines/search_provider_install_state_dispatcher_host.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_SEARCH_ENGINES_SEARCH_PROVIDER_INSTALL_STATE_DISPATCHER_HOST_H_ |
| +#define CHROME_BROWSER_SEARCH_ENGINES_SEARCH_PROVIDER_INSTALL_STATE_DISPATCHER_HOST_H_ |
| + |
| +#include "base/basictypes.h" |
| + |
| +namespace IPC { |
| +class Message; |
| +} |
| + |
| +class GURL; |
| +class Profile; |
| +class ResourceMessageFilter; |
| +struct ViewHostMsg_GetSearchProviderInstallState_Params; |
| + |
| +// Handles messages regarding search provider install state on the I/O thread. |
| +class SearchProviderInstallStateDispatcherHost { |
| + public: |
| + SearchProviderInstallStateDispatcherHost(ResourceMessageFilter* ipc_sender, |
|
sky
2010/08/23 16:00:29
Mention this is invoked on the UI thread.
|
| + Profile* profile); |
| + ~SearchProviderInstallStateDispatcherHost(); |
| + |
| + // Send a message to the renderer process. |
| + void Send(IPC::Message* message); |
| + |
| + // Called to possibly handle the incoming IPC message. Returns true if |
| + // handled. |
| + bool OnMessageReceived(const IPC::Message& message, bool* message_was_ok); |
| + |
| + private: |
| + // Figures out the install state for the search provider. |
| + ViewHostMsg_GetSearchProviderInstallState_Params |
| + GetSearchProviderInstallState(const GURL& page_location, |
| + const GURL& requested_host); |
| + |
| + // Starts handling the message requesting the search provider install state. |
| + void OnMsgGetSearchProviderInstallState(const GURL& page_location, |
| + const GURL& requested_host, |
| + IPC::Message* reply_msg); |
| + |
| + // Sends the reply message about the search provider install state. |
| + void ReplyWithProviderInstallState( |
| + IPC::Message* reply_msg, |
| + ViewHostMsg_GetSearchProviderInstallState_Params install_state); |
| + |
| + ResourceMessageFilter* ipc_sender_; |
| + const bool is_off_the_record_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SearchProviderInstallStateDispatcherHost); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_SEARCH_ENGINES_SEARCH_PROVIDER_INSTALL_STATE_DISPATCHER_HOST_H_ |