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 #include "content/browser/webui/web_ui_impl.h" | 5 #include "content/browser/webui/web_ui_impl.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "content/browser/child_process_security_policy_impl.h" | 10 #include "content/browser/child_process_security_policy_impl.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 void WebUIImpl::RenderViewCreated(RenderViewHost* render_view_host) { | 84 void WebUIImpl::RenderViewCreated(RenderViewHost* render_view_host) { |
85 controller_->RenderViewCreated(render_view_host); | 85 controller_->RenderViewCreated(render_view_host); |
86 | 86 |
87 // Do not attempt to set the toolkit property if WebUI is not enabled, e.g., | 87 // Do not attempt to set the toolkit property if WebUI is not enabled, e.g., |
88 // the bookmarks manager page. | 88 // the bookmarks manager page. |
89 if (!(bindings_ & BINDINGS_POLICY_WEB_UI)) | 89 if (!(bindings_ & BINDINGS_POLICY_WEB_UI)) |
90 return; | 90 return; |
91 | 91 |
92 #if defined(TOOLKIT_VIEWS) | 92 #if defined(TOOLKIT_VIEWS) |
93 render_view_host->SetWebUIProperty("toolkit", "views"); | 93 render_view_host->SetWebUIProperty("toolkit", "views"); |
94 #elif defined(TOOLKIT_GTK) | |
95 render_view_host->SetWebUIProperty("toolkit", "GTK"); | |
96 #endif // defined(TOOLKIT_VIEWS) | 94 #endif // defined(TOOLKIT_VIEWS) |
97 } | 95 } |
98 | 96 |
99 WebContents* WebUIImpl::GetWebContents() const { | 97 WebContents* WebUIImpl::GetWebContents() const { |
100 return web_contents_; | 98 return web_contents_; |
101 } | 99 } |
102 | 100 |
103 ui::ScaleFactor WebUIImpl::GetDeviceScaleFactor() const { | 101 ui::ScaleFactor WebUIImpl::GetDeviceScaleFactor() const { |
104 return GetScaleFactorForView(web_contents_->GetRenderWidgetHostView()); | 102 return GetScaleFactorForView(web_contents_->GetRenderWidgetHostView()); |
105 } | 103 } |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 } | 250 } |
253 | 251 |
254 void WebUIImpl::AddToSetIfFrameNameMatches( | 252 void WebUIImpl::AddToSetIfFrameNameMatches( |
255 std::set<RenderFrameHost*>* frame_set, | 253 std::set<RenderFrameHost*>* frame_set, |
256 RenderFrameHost* host) { | 254 RenderFrameHost* host) { |
257 if (host->GetFrameName() == frame_name_) | 255 if (host->GetFrameName() == frame_name_) |
258 frame_set->insert(host); | 256 frame_set->insert(host); |
259 } | 257 } |
260 | 258 |
261 } // namespace content | 259 } // namespace content |
OLD | NEW |