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

Side by Side Diff: content/public/browser/web_contents_observer.h

Issue 11416013: Move RequestPpapiBrokerPermission from WebContentsObserver to WebContentsDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 1 month 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_
7 7
8 #include "base/callback_forward.h"
9 #include "base/process_util.h" 8 #include "base/process_util.h"
10 #include "content/common/content_export.h" 9 #include "content/common/content_export.h"
11 #include "content/public/browser/navigation_controller.h" 10 #include "content/public/browser/navigation_controller.h"
12 #include "content/public/common/page_transition_types.h" 11 #include "content/public/common/page_transition_types.h"
13 #include "ipc/ipc_listener.h" 12 #include "ipc/ipc_listener.h"
14 #include "ipc/ipc_sender.h" 13 #include "ipc/ipc_sender.h"
15 #include "webkit/glue/window_open_disposition.h" 14 #include "webkit/glue/window_open_disposition.h"
16 15
17 namespace content { 16 namespace content {
18 17
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 WebContents* new_web_contents) {} 129 WebContents* new_web_contents) {}
131 130
132 // Invoked when the WebContents is being destroyed. Gives subclasses a chance 131 // Invoked when the WebContents is being destroyed. Gives subclasses a chance
133 // to cleanup. At the time this is invoked |web_contents()| returns NULL. 132 // to cleanup. At the time this is invoked |web_contents()| returns NULL.
134 // It is safe to delete 'this' from here. 133 // It is safe to delete 'this' from here.
135 virtual void WebContentsDestroyed(WebContents* web_contents) {} 134 virtual void WebContentsDestroyed(WebContents* web_contents) {}
136 135
137 // Called when the user agent override for a WebContents has been changed. 136 // Called when the user agent override for a WebContents has been changed.
138 virtual void UserAgentOverrideSet(const std::string& user_agent) {} 137 virtual void UserAgentOverrideSet(const std::string& user_agent) {}
139 138
140 // Requests permission to access the PPAPI broker. If the object handles the
141 // request, it should return true and eventually call the passed in |callback|
142 // with the result. Otherwise it should return false, in which case the next
143 // observer will be called.
144 // Implementations should make sure not to call the callback after the
145 // WebContents has been destroyed.
146 virtual bool RequestPpapiBrokerPermission(
147 WebContents* web_contents,
148 const GURL& url,
149 const FilePath& plugin_path,
150 const base::Callback<void(bool)>& callback);
151
152 // IPC::Listener implementation. 139 // IPC::Listener implementation.
153 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 140 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
154 141
155 // IPC::Sender implementation. 142 // IPC::Sender implementation.
156 virtual bool Send(IPC::Message* message) OVERRIDE; 143 virtual bool Send(IPC::Message* message) OVERRIDE;
157 int routing_id() const; 144 int routing_id() const;
158 145
159 protected: 146 protected:
160 // Use this constructor when the object is tied to a single WebContents for 147 // Use this constructor when the object is tied to a single WebContents for
161 // its entire lifetime. 148 // its entire lifetime.
(...skipping 19 matching lines...) Expand all
181 void WebContentsImplDestroyed(); 168 void WebContentsImplDestroyed();
182 169
183 WebContentsImpl* web_contents_; 170 WebContentsImpl* web_contents_;
184 171
185 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); 172 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver);
186 }; 173 };
187 174
188 } // namespace content 175 } // namespace content
189 176
190 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ 177 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698