Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: apps/app_web_contents_helper.h

Issue 423453002: Refactor AppWindow to enable code re-use with launcher pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | apps/app_web_contents_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 APPS_APP_WEB_CONTENTS_HELPER_H_
6 #define APPS_APP_WEB_CONTENTS_HELPER_H_
7
8 #include "content/public/common/console_message_level.h"
9 #include "content/public/common/media_stream_request.h"
10
11 namespace blink {
12 class WebGestureEvent;
13 }
14
15 namespace content {
16 class BrowserContext;
17 struct OpenURLParams;
18 class WebContents;
19 }
20
21 namespace extensions {
22 class Extension;
23 }
24
25 namespace apps {
26
27 class AppDelegate;
28
29 // Provides common functionality for apps and launcher pages to respond to
30 // messages from a WebContents.
31 class AppWebContentsHelper {
32 public:
33 AppWebContentsHelper(content::BrowserContext* browser_context,
34 const std::string& extension_id,
35 content::WebContents* web_contents,
36 AppDelegate* app_delegate);
37
38 // Returns true if the given |event| should not be handled by the renderer.
39 static bool ShouldSuppressGestureEvent(const blink::WebGestureEvent& event);
40
41 // Opens a new URL inside the passed in WebContents. See WebContentsDelegate.
42 content::WebContents* OpenURLFromTab(
43 const content::OpenURLParams& params) const;
44
45 // Requests to lock the mouse. See WebContentsDelegate.
46 void RequestToLockMouse() const;
47
48 // Asks permission to use the camera and/or microphone. See
49 // WebContentsDelegate.
50 void RequestMediaAccessPermission(
51 const content::MediaStreamRequest& request,
52 const content::MediaResponseCallback& callback) const;
53
54 const extensions::Extension* GetExtension() const;
benwells 2014/07/31 06:20:29 Why is this and browser_context() public?
Matt Giuca 2014/08/01 04:49:29 Not sure, I assume historical reasons! Deleted br
55
56 const content::BrowserContext* browser_context() const {
57 return browser_context_;
58 }
59
60 private:
61 // Helper method to add a message to the renderer's DevTools console.
62 void AddMessageToDevToolsConsole(content::ConsoleMessageLevel level,
63 const std::string& message) const;
64
65 // The browser context with which this window is associated.
66 // AppWindowWebContentsDelegate does not own this object.
67 content::BrowserContext* browser_context_;
68
69 const std::string extension_id_;
70
71 content::WebContents* web_contents_;
72
73 AppDelegate* app_delegate_;
benwells 2014/07/31 06:20:29 DISALLOW_COPY_AND_ASSIGN
Matt Giuca 2014/08/01 04:49:29 Done.
74 };
75
76 } // namespace apps
77
78 #endif // APPS_APP_WEB_CONTENTS_HELPER_H_
OLDNEW
« no previous file with comments | « no previous file | apps/app_web_contents_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698