summaryrefslogtreecommitdiffstats
path: root/content/browser/browser_plugin/test_browser_plugin_guest_delegate.h
blob: 910ff9f324f337f82e51ff595b7814b36e9619a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright 2013 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 CONTENT_BROWSER_BROWSER_PLUGIN_TEST_BROWSER_PLUGIN_GUEST_DELEGATE_H_
#define CONTENT_BROWSER_BROWSER_PLUGIN_TEST_BROWSER_PLUGIN_GUEST_DELEGATE_H_

#include "content/public/browser/browser_plugin_guest_delegate.h"

namespace content {

class TestBrowserPluginGuestDelegate : public BrowserPluginGuestDelegate {
 public:
  TestBrowserPluginGuestDelegate();
  virtual ~TestBrowserPluginGuestDelegate();

  void ResetStates();

  bool load_aborted() const { return load_aborted_; }
  const GURL& load_aborted_url() const { return load_aborted_url_; }

 private:
  // Overridden from BrowserPluginGuestDelegate:
  virtual void AddMessageToConsole(int32 level,
                                   const string16& message,
                                   int32 line_no,
                                   const string16& source_id) OVERRIDE;
  virtual void Close() OVERRIDE;
  virtual void GuestProcessGone(base::TerminationStatus status) OVERRIDE;
  virtual bool HandleKeyboardEvent(
      const NativeWebKeyboardEvent& event) OVERRIDE;
  virtual void LoadAbort(bool is_top_level,
                         const GURL& url,
                         const std::string& error_type) OVERRIDE;
  virtual void RendererResponsive() OVERRIDE;
  virtual void RendererUnresponsive() OVERRIDE;
  virtual bool RequestPermission(
      BrowserPluginPermissionType permission_type,
      const base::DictionaryValue& request_info,
      const PermissionResponseCallback& callback,
      bool allowed_by_default) OVERRIDE;
  virtual void SizeChanged(const gfx::Size& old_size,
                           const gfx::Size& new_size) OVERRIDE;

  bool load_aborted_;
  GURL load_aborted_url_;

  DISALLOW_COPY_AND_ASSIGN(TestBrowserPluginGuestDelegate);
};

}  // namespace content
#endif  // CONTENT_BROWSER_BROWSER_PLUGIN_TEST_BROWSER_PLUGIN_GUEST_DELEGATE_H_