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

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

Issue 9836127: Content shell: Javascript dialogs, first pass, just Mac for now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ifdef out for non-mac Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « content/shell/shell.h ('k') | content/shell/shell_javascript_dialog.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/shell/shell.h" 5 #include "content/shell/shell.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "content/public/browser/navigation_controller.h" 11 #include "content/public/browser/navigation_controller.h"
12 #include "content/public/browser/render_view_host.h" 12 #include "content/public/browser/render_view_host.h"
13 #include "content/public/browser/web_contents.h" 13 #include "content/public/browser/web_contents.h"
14 #include "content/shell/shell_javascript_dialog_creator.h"
14 #include "content/shell/shell_messages.h" 15 #include "content/shell/shell_messages.h"
15 #include "content/shell/shell_switches.h" 16 #include "content/shell/shell_switches.h"
16 #include "ui/gfx/size.h" 17 #include "ui/gfx/size.h"
17 18
18 // Content area size for newly created windows. 19 // Content area size for newly created windows.
19 static const int kTestWindowWidth = 800; 20 static const int kTestWindowWidth = 800;
20 static const int kTestWindowHeight = 600; 21 static const int kTestWindowHeight = 600;
21 22
22 namespace content { 23 namespace content {
23 24
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 int64 source_frame_id, 135 int64 source_frame_id,
135 const GURL& target_url, 136 const GURL& target_url,
136 WebContents* new_contents) { 137 WebContents* new_contents) {
137 CreateShell(new_contents); 138 CreateShell(new_contents);
138 } 139 }
139 140
140 void Shell::DidNavigateMainFramePostCommit(WebContents* tab) { 141 void Shell::DidNavigateMainFramePostCommit(WebContents* tab) {
141 PlatformSetAddressBarURL(tab->GetURL()); 142 PlatformSetAddressBarURL(tab->GetURL());
142 } 143 }
143 144
145 JavaScriptDialogCreator* Shell::GetJavaScriptDialogCreator() {
146 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
147 return NULL;
148
149 if (!dialog_creator_.get())
150 dialog_creator_.reset(new ShellJavaScriptDialogCreator());
151 return dialog_creator_.get();
152 }
153
144 void Shell::DidFinishLoad(int64 frame_id, 154 void Shell::DidFinishLoad(int64 frame_id,
145 const GURL& validated_url, 155 const GURL& validated_url,
146 bool is_main_frame) { 156 bool is_main_frame) {
147 if (!is_main_frame || wait_until_done_) 157 if (!is_main_frame || wait_until_done_)
148 return; 158 return;
149 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) 159 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
150 return; 160 return;
151 RenderViewHost* render_view_host = web_contents_->GetRenderViewHost(); 161 RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
152 render_view_host->Send( 162 render_view_host->Send(
153 new ShellViewMsg_CaptureTextDump(render_view_host->GetRoutingID(), 163 new ShellViewMsg_CaptureTextDump(render_view_host->GetRoutingID(),
154 false)); 164 false));
155 } 165 }
156 166
157 } // namespace content 167 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/shell.h ('k') | content/shell/shell_javascript_dialog.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698