Save errno for logging before potentially overwriting it.
[chromium-blink-merge.git] / content / public / browser / web_ui_controller.h
blob2bfba48d76952fbbf91553a64d8f301994d9c577
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.
5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_UI_CONTROLLER_H_
6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_CONTROLLER_H_
8 #include "base/basictypes.h"
9 #include "base/strings/string16.h"
10 #include "content/common/content_export.h"
12 class GURL;
14 namespace base {
15 class ListValue;
18 namespace content {
20 class RenderViewHost;
21 class WebUI;
23 // A WebUI page is controller by the embedder's WebUIController object. It
24 // manages the data source and message handlers.
25 class CONTENT_EXPORT WebUIController {
26 public:
27 explicit WebUIController(WebUI* web_ui) : web_ui_(web_ui) {}
28 virtual ~WebUIController() {}
30 // Allows the controller to override handling all messages from the page.
31 // Return true if the message handling was overridden.
32 virtual bool OverrideHandleWebUIMessage(const GURL& source_url,
33 const std::string& message,
34 const base::ListValue& args);
36 // Called when RenderView is first created. This is *not* called for every
37 // page load because in some cases a RenderView will be reused. In those
38 // cases, RenderViewReused will be called instead.
39 virtual void RenderViewCreated(RenderViewHost* render_view_host) {}
41 // Called when a RenderView is reused to display a page.
42 virtual void RenderViewReused(RenderViewHost* render_view_host) {}
44 WebUI* web_ui() const { return web_ui_; }
46 private:
47 WebUI* web_ui_;
50 } // namespace content
52 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_CONTROLLER_H_