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

Side by Side Diff: content/shell/browser/shell.cc

Issue 1470823002: Enable builtin Mojo JS modules in layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@usb-testing
Patch Set: oops, clumsy Created 4 years, 11 months 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/shell/browser/shell.h" 5 #include "content/shell/browser/shell.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/single_thread_task_runner.h" 13 #include "base/single_thread_task_runner.h"
14 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
15 #include "base/strings/string_util.h" 15 #include "base/strings/string_util.h"
16 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
17 #include "base/strings/utf_string_conversions.h" 17 #include "base/strings/utf_string_conversions.h"
18 #include "base/thread_task_runner_handle.h" 18 #include "base/thread_task_runner_handle.h"
19 #include "build/build_config.h" 19 #include "build/build_config.h"
20 #include "content/public/browser/devtools_agent_host.h" 20 #include "content/public/browser/devtools_agent_host.h"
21 #include "content/public/browser/navigation_controller.h" 21 #include "content/public/browser/navigation_controller.h"
22 #include "content/public/browser/navigation_entry.h" 22 #include "content/public/browser/navigation_entry.h"
23 #include "content/public/browser/render_view_host.h" 23 #include "content/public/browser/render_view_host.h"
24 #include "content/public/browser/render_widget_host.h" 24 #include "content/public/browser/render_widget_host.h"
25 #include "content/public/browser/web_contents.h" 25 #include "content/public/browser/web_contents.h"
26 #include "content/public/browser/web_contents_observer.h" 26 #include "content/public/browser/web_contents_observer.h"
27 #include "content/public/common/bindings_policy.h"
27 #include "content/public/common/content_switches.h" 28 #include "content/public/common/content_switches.h"
28 #include "content/public/common/renderer_preferences.h" 29 #include "content/public/common/renderer_preferences.h"
29 #include "content/public/common/webrtc_ip_handling_policy.h" 30 #include "content/public/common/webrtc_ip_handling_policy.h"
30 #include "content/shell/browser/blink_test_controller.h" 31 #include "content/shell/browser/blink_test_controller.h"
31 #include "content/shell/browser/layout_test/layout_test_bluetooth_chooser_factor y.h" 32 #include "content/shell/browser/layout_test/layout_test_bluetooth_chooser_factor y.h"
32 #include "content/shell/browser/layout_test/layout_test_devtools_frontend.h" 33 #include "content/shell/browser/layout_test/layout_test_devtools_frontend.h"
33 #include "content/shell/browser/layout_test/layout_test_javascript_dialog_manage r.h" 34 #include "content/shell/browser/layout_test/layout_test_javascript_dialog_manage r.h"
34 #include "content/shell/browser/notify_done_forwarder.h" 35 #include "content/shell/browser/notify_done_forwarder.h"
35 #include "content/shell/browser/shell_browser_main_parts.h" 36 #include "content/shell/browser/shell_browser_main_parts.h"
36 #include "content/shell/browser/shell_content_browser_client.h" 37 #include "content/shell/browser/shell_content_browser_client.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 web_contents->SetDelegate(shell); 116 web_contents->SetDelegate(shell);
116 117
117 shell->PlatformSetContents(); 118 shell->PlatformSetContents();
118 119
119 shell->PlatformResizeSubViews(); 120 shell->PlatformResizeSubViews();
120 121
121 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 122 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
122 if (command_line->HasSwitch(switches::kRunLayoutTest)) { 123 if (command_line->HasSwitch(switches::kRunLayoutTest)) {
123 web_contents->GetMutableRendererPrefs()->use_custom_colors = false; 124 web_contents->GetMutableRendererPrefs()->use_custom_colors = false;
124 web_contents->GetRenderViewHost()->SyncRendererPrefs(); 125 web_contents->GetRenderViewHost()->SyncRendererPrefs();
126 web_contents->GetRenderViewHost()->AllowBindings(BINDINGS_POLICY_MOJO);
125 } 127 }
126 128
127 #if defined(ENABLE_WEBRTC) 129 #if defined(ENABLE_WEBRTC)
128 if (command_line->HasSwitch(switches::kForceWebRtcIPHandlingPolicy)) { 130 if (command_line->HasSwitch(switches::kForceWebRtcIPHandlingPolicy)) {
129 web_contents->GetMutableRendererPrefs()->webrtc_ip_handling_policy = 131 web_contents->GetMutableRendererPrefs()->webrtc_ip_handling_policy =
130 command_line->GetSwitchValueASCII( 132 command_line->GetSwitchValueASCII(
131 switches::kForceWebRtcIPHandlingPolicy); 133 switches::kForceWebRtcIPHandlingPolicy);
132 } 134 }
133 #endif 135 #endif
134 136
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 devtools_frontend_->Activate(); 451 devtools_frontend_->Activate();
450 devtools_frontend_->Focus(); 452 devtools_frontend_->Focus();
451 } 453 }
452 454
453 void Shell::OnDevToolsWebContentsDestroyed() { 455 void Shell::OnDevToolsWebContentsDestroyed() {
454 devtools_observer_.reset(); 456 devtools_observer_.reset();
455 devtools_frontend_ = NULL; 457 devtools_frontend_ = NULL;
456 } 458 }
457 459
458 } // namespace content 460 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | third_party/WebKit/LayoutTests/harness-tests/mojo-helpers.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698