OLD | NEW |
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" |
(...skipping 21 matching lines...) Expand all Loading... |
32 #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" |
33 #include "content/shell/browser/layout_test/layout_test_devtools_frontend.h" | 33 #include "content/shell/browser/layout_test/layout_test_devtools_frontend.h" |
34 #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" |
35 #include "content/shell/browser/layout_test/secondary_test_window_observer.h" | 35 #include "content/shell/browser/layout_test/secondary_test_window_observer.h" |
36 #include "content/shell/browser/shell_browser_main_parts.h" | 36 #include "content/shell/browser/shell_browser_main_parts.h" |
37 #include "content/shell/browser/shell_content_browser_client.h" | 37 #include "content/shell/browser/shell_content_browser_client.h" |
38 #include "content/shell/browser/shell_devtools_frontend.h" | 38 #include "content/shell/browser/shell_devtools_frontend.h" |
39 #include "content/shell/browser/shell_javascript_dialog_manager.h" | 39 #include "content/shell/browser/shell_javascript_dialog_manager.h" |
40 #include "content/shell/common/shell_messages.h" | 40 #include "content/shell/common/shell_messages.h" |
41 #include "content/shell/common/shell_switches.h" | 41 #include "content/shell/common/shell_switches.h" |
| 42 #include "media/media_features.h" |
42 | 43 |
43 namespace content { | 44 namespace content { |
44 | 45 |
45 const int kDefaultTestWindowWidthDip = 800; | 46 const int kDefaultTestWindowWidthDip = 800; |
46 const int kDefaultTestWindowHeightDip = 600; | 47 const int kDefaultTestWindowHeightDip = 600; |
47 | 48 |
48 std::vector<Shell*> Shell::windows_; | 49 std::vector<Shell*> Shell::windows_; |
49 base::Callback<void(Shell*)> Shell::shell_created_callback_; | 50 base::Callback<void(Shell*)> Shell::shell_created_callback_; |
50 | 51 |
51 bool Shell::quit_message_loop_ = true; | 52 bool Shell::quit_message_loop_ = true; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 shell->PlatformResizeSubViews(); | 119 shell->PlatformResizeSubViews(); |
119 | 120 |
120 // Note: Do not make RenderFrameHost or RenderViewHost specific state changes | 121 // Note: Do not make RenderFrameHost or RenderViewHost specific state changes |
121 // here, because they will be forgotten after a cross-process navigation. Use | 122 // here, because they will be forgotten after a cross-process navigation. Use |
122 // RenderFrameCreated or RenderViewCreated instead. | 123 // RenderFrameCreated or RenderViewCreated instead. |
123 if (switches::IsRunLayoutTestSwitchPresent()) { | 124 if (switches::IsRunLayoutTestSwitchPresent()) { |
124 web_contents->GetMutableRendererPrefs()->use_custom_colors = false; | 125 web_contents->GetMutableRendererPrefs()->use_custom_colors = false; |
125 web_contents->GetRenderViewHost()->SyncRendererPrefs(); | 126 web_contents->GetRenderViewHost()->SyncRendererPrefs(); |
126 } | 127 } |
127 | 128 |
128 #if defined(ENABLE_WEBRTC) | 129 #if BUILDFLAG(ENABLE_WEBRTC) |
129 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 130 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
130 if (command_line->HasSwitch(switches::kForceWebRtcIPHandlingPolicy)) { | 131 if (command_line->HasSwitch(switches::kForceWebRtcIPHandlingPolicy)) { |
131 web_contents->GetMutableRendererPrefs()->webrtc_ip_handling_policy = | 132 web_contents->GetMutableRendererPrefs()->webrtc_ip_handling_policy = |
132 command_line->GetSwitchValueASCII( | 133 command_line->GetSwitchValueASCII( |
133 switches::kForceWebRtcIPHandlingPolicy); | 134 switches::kForceWebRtcIPHandlingPolicy); |
134 } | 135 } |
135 #endif | 136 #endif |
136 | 137 |
137 return shell; | 138 return shell; |
138 } | 139 } |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 if (entry) | 502 if (entry) |
502 PlatformSetTitle(entry->GetTitle()); | 503 PlatformSetTitle(entry->GetTitle()); |
503 } | 504 } |
504 | 505 |
505 void Shell::OnDevToolsWebContentsDestroyed() { | 506 void Shell::OnDevToolsWebContentsDestroyed() { |
506 devtools_observer_.reset(); | 507 devtools_observer_.reset(); |
507 devtools_frontend_ = NULL; | 508 devtools_frontend_ = NULL; |
508 } | 509 } |
509 | 510 |
510 } // namespace content | 511 } // namespace content |
OLD | NEW |