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/shell/shell.h" | 5 #include "content/shell/shell.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 PlatformSetIsLoading(source->IsLoading()); | 145 PlatformSetIsLoading(source->IsLoading()); |
146 } | 146 } |
147 | 147 |
148 void Shell::WebContentsCreated(WebContents* source_contents, | 148 void Shell::WebContentsCreated(WebContents* source_contents, |
149 int64 source_frame_id, | 149 int64 source_frame_id, |
150 const GURL& target_url, | 150 const GURL& target_url, |
151 WebContents* new_contents) { | 151 WebContents* new_contents) { |
152 CreateShell(new_contents); | 152 CreateShell(new_contents); |
153 } | 153 } |
154 | 154 |
155 void Shell::DidNavigateMainFramePostCommit(WebContents* tab) { | 155 void Shell::DidNavigateMainFramePostCommit(WebContents* web_contents) { |
156 PlatformSetAddressBarURL(tab->GetURL()); | 156 PlatformSetAddressBarURL(web_contents->GetURL()); |
157 } | 157 } |
158 | 158 |
159 JavaScriptDialogCreator* Shell::GetJavaScriptDialogCreator() { | 159 JavaScriptDialogCreator* Shell::GetJavaScriptDialogCreator() { |
160 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 160 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
161 return NULL; | 161 return NULL; |
162 | 162 |
163 if (!dialog_creator_.get()) | 163 if (!dialog_creator_.get()) |
164 dialog_creator_.reset(new ShellJavaScriptDialogCreator()); | 164 dialog_creator_.reset(new ShellJavaScriptDialogCreator()); |
165 return dialog_creator_.get(); | 165 return dialog_creator_.get(); |
166 } | 166 } |
167 | 167 |
168 void Shell::DidFinishLoad(int64 frame_id, | 168 void Shell::DidFinishLoad(int64 frame_id, |
169 const GURL& validated_url, | 169 const GURL& validated_url, |
170 bool is_main_frame) { | 170 bool is_main_frame) { |
171 if (!is_main_frame || wait_until_done_) | 171 if (!is_main_frame || wait_until_done_) |
172 return; | 172 return; |
173 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 173 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
174 return; | 174 return; |
175 RenderViewHost* render_view_host = web_contents_->GetRenderViewHost(); | 175 RenderViewHost* render_view_host = web_contents_->GetRenderViewHost(); |
176 render_view_host->Send( | 176 render_view_host->Send( |
177 new ShellViewMsg_CaptureTextDump(render_view_host->GetRoutingID(), | 177 new ShellViewMsg_CaptureTextDump(render_view_host->GetRoutingID(), |
178 false)); | 178 false)); |
179 } | 179 } |
180 | 180 |
181 } // namespace content | 181 } // namespace content |
OLD | NEW |