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

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

Issue 9188056: Start splitting out WebUI into an implementation class and an interface that each page implements... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_UI_CONTROLLER_H_
6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_CONTROLLER_H_
7 #pragma once
8
9 #include "base/basictypes.h"
10 #include "base/string16.h"
11 #include "content/common/content_export.h"
12
13 class GURL;
14 class RenderViewHost;
15
16 namespace base {
17 class ListValue;
18 }
19
20 namespace content {
21
22 // A WebUI page is controller by the embedder's WebUIController object. It
23 // manages the data source and message handlers.
24 class CONTENT_EXPORT WebUIController {
25 public:
26 virtual ~WebUIController() {}
27
28 // Allows the controller to override handling all messages from the page. If
29 // it wants to override it, |overridden| should be set to true.
30 virtual void HandleWebUIMessage(const GURL& source_url,
31 const std::string& message,
32 const base::ListValue& args,
33 bool* overridden) {}
Evan Stade 2012/01/12 23:55:37 why is overridden an outparam instead of return va
jam 2012/01/13 00:06:03 this is slightly nicer because we can then avoid a
34
35 // Called when RenderView is first created. This is *not* called for every
36 // page load because in some cases a RenderView will be reused. In those
37 // cases, RenderViewReused will be called instead.
38 virtual void RenderViewCreated(RenderViewHost* render_view_host) {}
39
40 // Called when a RenderView is reused to display a page.
41 virtual void RenderViewReused(RenderViewHost* render_view_host) {}
42
43 // Called when this becomes the active WebUI instance for a re-used
44 // RenderView; this is the point at which this WebUI instance will receive
45 // DOM messages instead of the previous WebUI instance.
46 //
47 // If a WebUI instance has code that is usually triggered from a JavaScript
48 // onload handler, this should be overridden to check to see if the web page's
49 // DOM is still intact (e.g., due to a back/forward navigation that remains
50 // within the same page), and if so trigger that code manually since onload
51 // won't be run in that case.
52 virtual void DidBecomeActiveForReusedRenderView() {}
53 };
54
55 } // namespace content
56
57 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698