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 "chrome/renderer/chrome_render_thread_observer.h" | 5 #include "chrome/renderer/chrome_render_thread_observer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <memory> | 10 #include <memory> |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 &ChromeRenderThreadObserver::OnRendererConfigurationAssociatedRequest, | 281 &ChromeRenderThreadObserver::OnRendererConfigurationAssociatedRequest, |
282 base::Unretained(this))); | 282 base::Unretained(this))); |
283 } | 283 } |
284 | 284 |
285 void ChromeRenderThreadObserver::UnregisterMojoInterfaces( | 285 void ChromeRenderThreadObserver::UnregisterMojoInterfaces( |
286 content::AssociatedInterfaceRegistry* associated_interfaces) { | 286 content::AssociatedInterfaceRegistry* associated_interfaces) { |
287 associated_interfaces->RemoveInterface( | 287 associated_interfaces->RemoveInterface( |
288 chrome::mojom::RendererConfiguration::Name_); | 288 chrome::mojom::RendererConfiguration::Name_); |
289 } | 289 } |
290 | 290 |
291 bool ChromeRenderThreadObserver::OnControlMessageReceived( | |
292 const IPC::Message& message) { | |
293 bool handled = true; | |
294 IPC_BEGIN_MESSAGE_MAP(ChromeRenderThreadObserver, message) | |
295 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetFieldTrialGroup, OnSetFieldTrialGroup) | |
296 IPC_MESSAGE_UNHANDLED(handled = false) | |
297 IPC_END_MESSAGE_MAP() | |
298 return handled; | |
299 } | |
300 | |
301 void ChromeRenderThreadObserver::OnRenderProcessShutdown() { | 291 void ChromeRenderThreadObserver::OnRenderProcessShutdown() { |
302 visited_link_slave_.reset(); | 292 visited_link_slave_.reset(); |
303 | 293 |
304 // Workaround for http://crbug.com/672646 | 294 // Workaround for http://crbug.com/672646 |
305 renderer_configuration_bindings_.CloseAllBindings(); | 295 renderer_configuration_bindings_.CloseAllBindings(); |
306 } | 296 } |
307 | 297 |
308 void ChromeRenderThreadObserver::OnFieldTrialGroupFinalized( | 298 void ChromeRenderThreadObserver::OnFieldTrialGroupFinalized( |
309 const std::string& trial_name, | 299 const std::string& trial_name, |
310 const std::string& group_name) { | 300 const std::string& group_name) { |
311 chrome::mojom::FieldTrialRecorderPtr field_trial_recorder; | 301 chrome::mojom::FieldTrialRecorderPtr field_trial_recorder; |
312 content::RenderThread::Get()->GetRemoteInterfaces()->GetInterface( | 302 content::RenderThread::Get()->GetRemoteInterfaces()->GetInterface( |
313 &field_trial_recorder); | 303 &field_trial_recorder); |
314 field_trial_recorder->FieldTrialActivated(trial_name); | 304 field_trial_recorder->FieldTrialActivated(trial_name); |
315 } | 305 } |
316 | 306 |
317 void ChromeRenderThreadObserver::SetInitialConfiguration( | 307 void ChromeRenderThreadObserver::SetInitialConfiguration( |
318 bool is_incognito_process) { | 308 bool is_incognito_process) { |
319 is_incognito_process_ = is_incognito_process; | 309 is_incognito_process_ = is_incognito_process; |
320 } | 310 } |
321 | 311 |
322 void ChromeRenderThreadObserver::SetContentSettingRules( | 312 void ChromeRenderThreadObserver::SetContentSettingRules( |
323 const RendererContentSettingRules& rules) { | 313 const RendererContentSettingRules& rules) { |
324 content_setting_rules_ = rules; | 314 content_setting_rules_ = rules; |
325 } | 315 } |
326 | 316 |
| 317 void ChromeRenderThreadObserver::SetFieldTrialGroup( |
| 318 const std::string& trial_name, |
| 319 const std::string& group_name) { |
| 320 field_trial_syncer_.OnSetFieldTrialGroup(trial_name, group_name); |
| 321 } |
| 322 |
327 void ChromeRenderThreadObserver::OnRendererConfigurationAssociatedRequest( | 323 void ChromeRenderThreadObserver::OnRendererConfigurationAssociatedRequest( |
328 chrome::mojom::RendererConfigurationAssociatedRequest request) { | 324 chrome::mojom::RendererConfigurationAssociatedRequest request) { |
329 renderer_configuration_bindings_.AddBinding(this, std::move(request)); | 325 renderer_configuration_bindings_.AddBinding(this, std::move(request)); |
330 } | 326 } |
331 | 327 |
332 void ChromeRenderThreadObserver::OnSetFieldTrialGroup( | |
333 const std::string& trial_name, | |
334 const std::string& group_name) { | |
335 field_trial_syncer_.OnSetFieldTrialGroup(trial_name, group_name); | |
336 } | |
337 | |
338 const RendererContentSettingRules* | 328 const RendererContentSettingRules* |
339 ChromeRenderThreadObserver::content_setting_rules() const { | 329 ChromeRenderThreadObserver::content_setting_rules() const { |
340 return &content_setting_rules_; | 330 return &content_setting_rules_; |
341 } | 331 } |
OLD | NEW |