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

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
« no previous file with comments | « content/content_browser.gypi ('k') | content/public/browser/web_ui_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
29 // Return true if the message handling was overridden.
30 virtual bool OverrideHandleWebUIMessage(const GURL& source_url,
31 const std::string& message,
32 const base::ListValue& args);
33
34 // Called when RenderView is first created. This is *not* called for every
35 // page load because in some cases a RenderView will be reused. In those
36 // cases, RenderViewReused will be called instead.
37 virtual void RenderViewCreated(RenderViewHost* render_view_host) {}
38
39 // Called when a RenderView is reused to display a page.
40 virtual void RenderViewReused(RenderViewHost* render_view_host) {}
41
42 // Called when this becomes the active WebUI instance for a re-used
43 // RenderView; this is the point at which this WebUI instance will receive
44 // DOM messages instead of the previous WebUI instance.
45 //
46 // If a WebUI instance has code that is usually triggered from a JavaScript
47 // onload handler, this should be overridden to check to see if the web page's
48 // DOM is still intact (e.g., due to a back/forward navigation that remains
49 // within the same page), and if so trigger that code manually since onload
50 // won't be run in that case.
51 virtual void DidBecomeActiveForReusedRenderView() {}
52 };
53
54 } // namespace content
55
56 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_CONTROLLER_H_
OLDNEW
« no previous file with comments | « content/content_browser.gypi ('k') | content/public/browser/web_ui_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698