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

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

Issue 12317133: [content shell] don't require a user action for focus/blur events during layout tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years, 9 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_render_process_observer.cc » ('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/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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 const string16& source_id) { 281 const string16& source_id) {
282 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree); 282 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree);
283 } 283 }
284 284
285 void Shell::RendererUnresponsive(WebContents* source) { 285 void Shell::RendererUnresponsive(WebContents* source) {
286 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) 286 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
287 return; 287 return;
288 WebKitTestController::Get()->RendererUnresponsive(); 288 WebKitTestController::Get()->RendererUnresponsive();
289 } 289 }
290 290
291 void Shell::ActivateContents(WebContents* contents) {
292 contents->GetRenderViewHost()->Focus();
293 }
294
295 void Shell::DeactivateContents(WebContents* contents) {
296 contents->GetRenderViewHost()->Blur();
297 }
298
291 void Shell::Observe(int type, 299 void Shell::Observe(int type,
292 const NotificationSource& source, 300 const NotificationSource& source,
293 const NotificationDetails& details) { 301 const NotificationDetails& details) {
294 if (type == NOTIFICATION_WEB_CONTENTS_TITLE_UPDATED) { 302 if (type == NOTIFICATION_WEB_CONTENTS_TITLE_UPDATED) {
295 std::pair<NavigationEntry*, bool>* title = 303 std::pair<NavigationEntry*, bool>* title =
296 Details<std::pair<NavigationEntry*, bool> >(details).ptr(); 304 Details<std::pair<NavigationEntry*, bool> >(details).ptr();
297 305
298 if (title->first) { 306 if (title->first) {
299 string16 text = title->first->GetTitle(); 307 string16 text = title->first->GetTitle();
300 PlatformSetTitle(text); 308 PlatformSetTitle(text);
301 } 309 }
302 } 310 }
303 } 311 }
304 312
305 } // namespace content 313 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/shell.h ('k') | content/shell/shell_render_process_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698