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

Side by Side Diff: chrome/renderer/chrome_render_thread_observer.cc

Issue 2582203003: Convert SetContentSettingRules to use mojo, part 1/2. (Closed)
Patch Set: Created 4 years 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
OLDNEW
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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 content::AssociatedInterfaceRegistry* associated_interfaces) { 287 content::AssociatedInterfaceRegistry* associated_interfaces) {
288 associated_interfaces->RemoveInterface( 288 associated_interfaces->RemoveInterface(
289 chrome::mojom::RendererConfiguration::Name_); 289 chrome::mojom::RendererConfiguration::Name_);
290 } 290 }
291 291
292 bool ChromeRenderThreadObserver::OnControlMessageReceived( 292 bool ChromeRenderThreadObserver::OnControlMessageReceived(
293 const IPC::Message& message) { 293 const IPC::Message& message) {
294 bool handled = true; 294 bool handled = true;
295 IPC_BEGIN_MESSAGE_MAP(ChromeRenderThreadObserver, message) 295 IPC_BEGIN_MESSAGE_MAP(ChromeRenderThreadObserver, message)
296 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetFieldTrialGroup, OnSetFieldTrialGroup) 296 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetFieldTrialGroup, OnSetFieldTrialGroup)
297 // TODO(nigeltao): delete this handler when all senders of
298 // ChromeViewMsg_SetContentSettingRules have been converted to Mojo.
297 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetContentSettingRules, 299 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetContentSettingRules,
298 OnSetContentSettingRules) 300 SetContentSettingRules)
299 IPC_MESSAGE_UNHANDLED(handled = false) 301 IPC_MESSAGE_UNHANDLED(handled = false)
300 IPC_END_MESSAGE_MAP() 302 IPC_END_MESSAGE_MAP()
301 return handled; 303 return handled;
302 } 304 }
303 305
304 void ChromeRenderThreadObserver::OnRenderProcessShutdown() { 306 void ChromeRenderThreadObserver::OnRenderProcessShutdown() {
305 visited_link_slave_.reset(); 307 visited_link_slave_.reset();
306 308
307 // Workaround for http://crbug.com/672646 309 // Workaround for http://crbug.com/672646
308 if (renderer_configuration_binding_.is_bound()) 310 if (renderer_configuration_binding_.is_bound())
309 renderer_configuration_binding_.Unbind(); 311 renderer_configuration_binding_.Unbind();
310 } 312 }
311 313
312 void ChromeRenderThreadObserver::OnFieldTrialGroupFinalized( 314 void ChromeRenderThreadObserver::OnFieldTrialGroupFinalized(
313 const std::string& trial_name, 315 const std::string& trial_name,
314 const std::string& group_name) { 316 const std::string& group_name) {
315 chrome::mojom::FieldTrialRecorderPtr field_trial_recorder; 317 chrome::mojom::FieldTrialRecorderPtr field_trial_recorder;
316 content::RenderThread::Get()->GetRemoteInterfaces()->GetInterface( 318 content::RenderThread::Get()->GetRemoteInterfaces()->GetInterface(
317 &field_trial_recorder); 319 &field_trial_recorder);
318 field_trial_recorder->FieldTrialActivated(trial_name); 320 field_trial_recorder->FieldTrialActivated(trial_name);
319 } 321 }
320 322
321 void ChromeRenderThreadObserver::SetInitialConfiguration( 323 void ChromeRenderThreadObserver::SetInitialConfiguration(
322 bool is_incognito_process) { 324 bool is_incognito_process) {
323 is_incognito_process_ = is_incognito_process; 325 is_incognito_process_ = is_incognito_process;
324 } 326 }
325 327
328 void ChromeRenderThreadObserver::SetContentSettingRules(
329 const RendererContentSettingRules& rules) {
330 content_setting_rules_ = rules;
331 }
332
326 void ChromeRenderThreadObserver::OnRendererInterfaceRequest( 333 void ChromeRenderThreadObserver::OnRendererInterfaceRequest(
327 chrome::mojom::RendererConfigurationAssociatedRequest request) { 334 chrome::mojom::RendererConfigurationAssociatedRequest request) {
328 DCHECK(!renderer_configuration_binding_.is_bound()); 335 DCHECK(!renderer_configuration_binding_.is_bound());
329 renderer_configuration_binding_.Bind(std::move(request)); 336 renderer_configuration_binding_.Bind(std::move(request));
330 } 337 }
331 338
332 void ChromeRenderThreadObserver::OnSetContentSettingRules(
333 const RendererContentSettingRules& rules) {
334 content_setting_rules_ = rules;
335 }
336
337 void ChromeRenderThreadObserver::OnSetFieldTrialGroup( 339 void ChromeRenderThreadObserver::OnSetFieldTrialGroup(
338 const std::string& trial_name, 340 const std::string& trial_name,
339 const std::string& group_name) { 341 const std::string& group_name) {
340 field_trial_syncer_.OnSetFieldTrialGroup(trial_name, group_name); 342 field_trial_syncer_.OnSetFieldTrialGroup(trial_name, group_name);
341 } 343 }
342 344
343 const RendererContentSettingRules* 345 const RendererContentSettingRules*
344 ChromeRenderThreadObserver::content_setting_rules() const { 346 ChromeRenderThreadObserver::content_setting_rules() const {
345 return &content_setting_rules_; 347 return &content_setting_rules_;
346 } 348 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698