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

Side by Side Diff: content/renderer/render_view.cc

Issue 6713084: Move the rest of the renderer->browser messages that belong in content. Also do a bunch of cleanup: (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/renderer/render_view.h" 5 #include "content/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 } else if (node.isElementNode()) { 424 } else if (node.isElementNode()) {
425 is_editable_node = 425 is_editable_node =
426 node.toConst<WebElement>().isTextFormControlElement(); 426 node.toConst<WebElement>().isTextFormControlElement();
427 } 427 }
428 } 428 }
429 return is_editable_node; 429 return is_editable_node;
430 } 430 }
431 431
432 static bool WebAccessibilityNotificationToViewHostMsg( 432 static bool WebAccessibilityNotificationToViewHostMsg(
433 WebAccessibilityNotification notification, 433 WebAccessibilityNotification notification,
434 ViewHostMsg_AccessibilityNotification_Params::NotificationType* type) { 434 ViewHostMsg_AccessibilityNotification_Type::Value* type) {
435 switch (notification) { 435 switch (notification) {
436 case WebKit::WebAccessibilityNotificationCheckedStateChanged: 436 case WebKit::WebAccessibilityNotificationCheckedStateChanged:
437 *type = ViewHostMsg_AccessibilityNotification_Params:: 437 *type = ViewHostMsg_AccessibilityNotification_Type::
438 NOTIFICATION_TYPE_CHECK_STATE_CHANGED; 438 NOTIFICATION_TYPE_CHECK_STATE_CHANGED;
439 break; 439 break;
440 case WebKit::WebAccessibilityNotificationChildrenChanged: 440 case WebKit::WebAccessibilityNotificationChildrenChanged:
441 *type = ViewHostMsg_AccessibilityNotification_Params:: 441 *type = ViewHostMsg_AccessibilityNotification_Type::
442 NOTIFICATION_TYPE_CHILDREN_CHANGED; 442 NOTIFICATION_TYPE_CHILDREN_CHANGED;
443 break; 443 break;
444 case WebKit::WebAccessibilityNotificationFocusedUIElementChanged: 444 case WebKit::WebAccessibilityNotificationFocusedUIElementChanged:
445 *type = ViewHostMsg_AccessibilityNotification_Params:: 445 *type = ViewHostMsg_AccessibilityNotification_Type::
446 NOTIFICATION_TYPE_FOCUS_CHANGED; 446 NOTIFICATION_TYPE_FOCUS_CHANGED;
447 break; 447 break;
448 case WebKit::WebAccessibilityNotificationLoadComplete: 448 case WebKit::WebAccessibilityNotificationLoadComplete:
449 *type = ViewHostMsg_AccessibilityNotification_Params:: 449 *type = ViewHostMsg_AccessibilityNotification_Type::
450 NOTIFICATION_TYPE_LOAD_COMPLETE; 450 NOTIFICATION_TYPE_LOAD_COMPLETE;
451 break; 451 break;
452 case WebKit::WebAccessibilityNotificationValueChanged: 452 case WebKit::WebAccessibilityNotificationValueChanged:
453 *type = ViewHostMsg_AccessibilityNotification_Params:: 453 *type = ViewHostMsg_AccessibilityNotification_Type::
454 NOTIFICATION_TYPE_VALUE_CHANGED; 454 NOTIFICATION_TYPE_VALUE_CHANGED;
455 break; 455 break;
456 case WebKit::WebAccessibilityNotificationSelectedTextChanged: 456 case WebKit::WebAccessibilityNotificationSelectedTextChanged:
457 *type = ViewHostMsg_AccessibilityNotification_Params:: 457 *type = ViewHostMsg_AccessibilityNotification_Type::
458 NOTIFICATION_TYPE_SELECTED_TEXT_CHANGED; 458 NOTIFICATION_TYPE_SELECTED_TEXT_CHANGED;
459 break; 459 break;
460 default: 460 default:
461 // TODO(ctguil): Support additional webkit notifications. 461 // TODO(ctguil): Support additional webkit notifications.
462 return false; 462 return false;
463 } 463 }
464 return true; 464 return true;
465 } 465 }
466 466
467 // Conversion for the incoming value. The map isn't perfect; v8 has Uint32, 467 // Conversion for the incoming value. The map isn't perfect; v8 has Uint32,
(...skipping 4474 matching lines...) Expand 10 before | Expand all | Expand 10 after
4942 return; 4942 return;
4943 } 4943 }
4944 4944
4945 // Add the accessibility object to our cache and ensure it's valid. 4945 // Add the accessibility object to our cache and ensure it's valid.
4946 RendererAccessibilityNotification acc_notification; 4946 RendererAccessibilityNotification acc_notification;
4947 acc_notification.id = accessibility_->addOrGetId(obj); 4947 acc_notification.id = accessibility_->addOrGetId(obj);
4948 acc_notification.type = notification; 4948 acc_notification.type = notification;
4949 if (acc_notification.id < 0) 4949 if (acc_notification.id < 0)
4950 return; 4950 return;
4951 4951
4952 ViewHostMsg_AccessibilityNotification_Params::NotificationType temp; 4952 ViewHostMsg_AccessibilityNotification_Type::Value temp;
4953 if (!WebAccessibilityNotificationToViewHostMsg(notification, &temp)) 4953 if (!WebAccessibilityNotificationToViewHostMsg(notification, &temp))
4954 return; 4954 return;
4955 4955
4956 // Discard duplicate accessibility notifications. 4956 // Discard duplicate accessibility notifications.
4957 for (uint32 i = 0; i < pending_accessibility_notifications_.size(); i++) { 4957 for (uint32 i = 0; i < pending_accessibility_notifications_.size(); i++) {
4958 if (pending_accessibility_notifications_[i].id == acc_notification.id && 4958 if (pending_accessibility_notifications_[i].id == acc_notification.id &&
4959 pending_accessibility_notifications_[i].type == acc_notification.type) { 4959 pending_accessibility_notifications_[i].type == acc_notification.type) {
4960 return; 4960 return;
4961 } 4961 }
4962 } 4962 }
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
5390 const webkit_glue::CustomContextMenuContext& custom_context) { 5390 const webkit_glue::CustomContextMenuContext& custom_context) {
5391 if (custom_context.is_pepper_menu) 5391 if (custom_context.is_pepper_menu)
5392 pepper_delegate_.OnContextMenuClosed(custom_context); 5392 pepper_delegate_.OnContextMenuClosed(custom_context);
5393 else 5393 else
5394 context_menu_node_.reset(); 5394 context_menu_node_.reset();
5395 } 5395 }
5396 5396
5397 void RenderView::OnNetworkStateChanged(bool online) { 5397 void RenderView::OnNetworkStateChanged(bool online) {
5398 WebNetworkStateNotifier::setOnLine(online); 5398 WebNetworkStateNotifier::setOnLine(online);
5399 } 5399 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698