browser_plugin_guest_delegate.h revision 7dbb3d5cf0c15f500944d211057644d6a2f37371
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. 4 5#ifndef CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ 6#define CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ 7 8#include "base/process_util.h" 9#include "base/strings/string16.h" 10#include "content/common/content_export.h" 11 12namespace content { 13 14struct NativeWebKeyboardEvent; 15 16// Objects implement this interface to get notified about changes in the guest 17// WebContents and to provide necessary functionality. 18class CONTENT_EXPORT BrowserPluginGuestDelegate { 19 public: 20 virtual ~BrowserPluginGuestDelegate() {} 21 22 // Add a message to the console. 23 virtual void AddMessageToConsole(int32 level, 24 const string16& message, 25 int32 line_no, 26 const string16& source_id) {} 27 28 // Request the delegate to close this guest, and do whatever cleanup it needs 29 // to do. 30 virtual void Close() {} 31 32 // Informs the delegate that the guest render process is gone. |status| 33 // indicates whether the guest was killed, crashed, or was terminated 34 // gracefully. 35 virtual void GuestProcessGone(base::TerminationStatus status) {} 36 37 virtual bool HandleKeyboardEvent(const NativeWebKeyboardEvent& event); 38}; 39 40} // namespace content 41 42#endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ 43