| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |