- add sources.
[platform/framework/web/crosswalk.git] / src / content / browser / browser_plugin / test_browser_plugin_guest_delegate.h
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_BROWSER_BROWSER_PLUGIN_TEST_BROWSER_PLUGIN_GUEST_DELEGATE_H_
6 #define CONTENT_BROWSER_BROWSER_PLUGIN_TEST_BROWSER_PLUGIN_GUEST_DELEGATE_H_
7
8 #include "content/public/browser/browser_plugin_guest_delegate.h"
9
10 namespace content {
11
12 class TestBrowserPluginGuestDelegate : public BrowserPluginGuestDelegate {
13  public:
14   TestBrowserPluginGuestDelegate();
15   virtual ~TestBrowserPluginGuestDelegate();
16
17   void ResetStates();
18
19   bool load_aborted() const { return load_aborted_; }
20   const GURL& load_aborted_url() const { return load_aborted_url_; }
21
22  private:
23   // Overridden from BrowserPluginGuestDelegate:
24   virtual void AddMessageToConsole(int32 level,
25                                    const string16& message,
26                                    int32 line_no,
27                                    const string16& source_id) OVERRIDE;
28   virtual void Close() OVERRIDE;
29   virtual void GuestProcessGone(base::TerminationStatus status) OVERRIDE;
30   virtual bool HandleKeyboardEvent(
31       const NativeWebKeyboardEvent& event) OVERRIDE;
32   virtual void LoadAbort(bool is_top_level,
33                          const GURL& url,
34                          const std::string& error_type) OVERRIDE;
35   virtual void RendererResponsive() OVERRIDE;
36   virtual void RendererUnresponsive() OVERRIDE;
37   virtual bool RequestPermission(
38       BrowserPluginPermissionType permission_type,
39       const base::DictionaryValue& request_info,
40       const PermissionResponseCallback& callback,
41       bool allowed_by_default) OVERRIDE;
42   virtual void SizeChanged(const gfx::Size& old_size,
43                            const gfx::Size& new_size) OVERRIDE;
44
45   bool load_aborted_;
46   GURL load_aborted_url_;
47
48   DISALLOW_COPY_AND_ASSIGN(TestBrowserPluginGuestDelegate);
49 };
50
51 }  // namespace content
52 #endif  // CONTENT_BROWSER_BROWSER_PLUGIN_TEST_BROWSER_PLUGIN_GUEST_DELEGATE_H_