| OLD | NEW |
| 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_BROWSER_WEBUI_WEB_UI_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_WEBUI_WEB_UI_IMPL_H_ |
| 6 #define CONTENT_BROWSER_WEBUI_WEB_UI_IMPL_H_ | 6 #define CONTENT_BROWSER_WEBUI_WEB_UI_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "content/public/browser/web_ui.h" | 14 #include "content/public/browser/web_ui.h" |
| 15 #include "ipc/ipc_listener.h" | 15 #include "ipc/ipc_listener.h" |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 class RenderFrameHost; | 18 class RenderFrameHost; |
| 19 class RenderViewHost; | 19 class RenderViewHost; |
| 20 | 20 |
| 21 class CONTENT_EXPORT WebUIImpl : public WebUI, | 21 class CONTENT_EXPORT WebUIImpl : public WebUI, |
| 22 public IPC::Listener, | 22 public IPC::Listener, |
| 23 public base::SupportsWeakPtr<WebUIImpl> { | 23 public base::SupportsWeakPtr<WebUIImpl> { |
| 24 public: | 24 public: |
| 25 WebUIImpl(WebContents* contents, const std::string& frame_name); | 25 WebUIImpl(WebContents* contents, const std::string& frame_name); |
| 26 ~WebUIImpl() override; | 26 ~WebUIImpl() override; |
| 27 | 27 |
| 28 // Called when a RenderView is created for a WebUI (reload after a renderer | 28 // Called by WebContentsImpl when the RenderView is first created. This is |
| 29 // crash) or when a WebUI is created for an RenderView (i.e. navigating from | 29 // *not* called for every page load because in some cases |
| 30 // chrome://downloads to chrome://bookmarks) or when both are new (i.e. | 30 // RenderFrameHostManager will reuse RenderView instances. |
| 31 // opening a new tab). | |
| 32 void RenderViewCreated(RenderViewHost* render_view_host); | 31 void RenderViewCreated(RenderViewHost* render_view_host); |
| 33 | 32 |
| 34 // Called when a RenderView is reused for the same WebUI type (i.e. reload). | 33 // Called by WebContentsImpl when the RenderView is reused. This happens on |
| 34 // refresh or when the main page is navigated within the same SiteInstance. |
| 35 void RenderViewReused(RenderViewHost* render_view_host, bool was_main_frame); | 35 void RenderViewReused(RenderViewHost* render_view_host, bool was_main_frame); |
| 36 | 36 |
| 37 // WebUI implementation: | 37 // WebUI implementation: |
| 38 WebContents* GetWebContents() const override; | 38 WebContents* GetWebContents() const override; |
| 39 WebUIController* GetController() const override; | 39 WebUIController* GetController() const override; |
| 40 void SetController(WebUIController* controller) override; | 40 void SetController(WebUIController* controller) override; |
| 41 float GetDeviceScaleFactor() const override; | 41 float GetDeviceScaleFactor() const override; |
| 42 const base::string16& GetOverriddenTitle() const override; | 42 const base::string16& GetOverriddenTitle() const override; |
| 43 void OverrideTitle(const base::string16& title) override; | 43 void OverrideTitle(const base::string16& title) override; |
| 44 ui::PageTransition GetLinkTransitionType() const override; | 44 ui::PageTransition GetLinkTransitionType() const override; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 const std::string frame_name_; | 116 const std::string frame_name_; |
| 117 | 117 |
| 118 scoped_ptr<WebUIController> controller_; | 118 scoped_ptr<WebUIController> controller_; |
| 119 | 119 |
| 120 DISALLOW_COPY_AND_ASSIGN(WebUIImpl); | 120 DISALLOW_COPY_AND_ASSIGN(WebUIImpl); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 } // namespace content | 123 } // namespace content |
| 124 | 124 |
| 125 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_IMPL_H_ | 125 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_IMPL_H_ |
| OLD | NEW |