Upstream version 11.40.271.0
[platform/framework/web/crosswalk.git] / src / content / shell / browser / layout_test / layout_test_content_browser_client.h
1 // Copyright 2014 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_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_CONTENT_BROWSER_CLIENT_H_
6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_CONTENT_BROWSER_CLIENT_H_
7
8 #include "content/public/browser/permission_type.h"
9 #include "content/shell/browser/shell_content_browser_client.h"
10
11 namespace content {
12
13 class LayoutTestNotificationManager;
14
15 class LayoutTestContentBrowserClient : public ShellContentBrowserClient {
16  public:
17   // Gets the current instance.
18   static LayoutTestContentBrowserClient* Get();
19
20   LayoutTestContentBrowserClient();
21   ~LayoutTestContentBrowserClient() override;
22
23   // Will be lazily created when running layout tests.
24   LayoutTestNotificationManager* GetLayoutTestNotificationManager();
25
26   // ContentBrowserClient overrides.
27   void RenderProcessWillLaunch(RenderProcessHost* host) override;
28   void RequestPermission(
29       PermissionType permission,
30       WebContents* web_contents,
31       int bridge_id,
32       const GURL& requesting_frame,
33       bool user_gesture,
34       const base::Callback<void(bool)>& result_callback) override;
35   blink::WebNotificationPermission CheckDesktopNotificationPermission(
36       const GURL& source_url,
37       ResourceContext* context,
38       int render_process_id) override;
39   void ShowDesktopNotification(
40       const ShowDesktopNotificationHostMsgParams& params,
41       BrowserContext* browser_context,
42       int render_process_id,
43       scoped_ptr<DesktopNotificationDelegate> delegate,
44       base::Closure* cancel_callback) override;
45
46  private:
47   scoped_ptr<LayoutTestNotificationManager> layout_test_notification_manager_;
48 };
49
50 }  // content
51
52 #endif  // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_CONTENT_BROWSER_CLIENT_H_