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

Side by Side Diff: content/browser/renderer_host/render_view_host.cc

Issue 6874038: Remove the last Chrome dependencies from renderer, and enforce no more includes through DEPS. I ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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
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/browser/renderer_host/render_view_host.h" 5 #include "content/browser/renderer_host/render_view_host.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/i18n/rtl.h" 12 #include "base/i18n/rtl.h"
13 #include "base/json/json_reader.h" 13 #include "base/json/json_reader.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "base/time.h" 15 #include "base/time.h"
16 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
17 #include "base/values.h" 17 #include "base/values.h"
18 #include "chrome/browser/dom_operation_notification_details.h" 18 #include "chrome/browser/dom_operation_notification_details.h"
19 #include "chrome/browser/metrics/user_metrics.h" 19 #include "chrome/browser/metrics/user_metrics.h"
20 #include "chrome/browser/net/predictor_api.h" 20 #include "chrome/browser/net/predictor_api.h"
21 #include "chrome/browser/profiles/profile.h" 21 #include "chrome/browser/profiles/profile.h"
22 #include "chrome/common/bindings_policy.h"
23 #include "chrome/common/chrome_constants.h" 22 #include "chrome/common/chrome_constants.h"
24 #include "chrome/common/chrome_switches.h" 23 #include "chrome/common/chrome_switches.h"
25 #include "chrome/common/extensions/extension_messages.h" 24 #include "chrome/common/extensions/extension_messages.h"
26 #include "chrome/common/render_messages.h" 25 #include "chrome/common/render_messages.h"
27 #include "chrome/common/safe_browsing/safebrowsing_messages.h" 26 #include "chrome/common/safe_browsing/safebrowsing_messages.h"
28 #include "chrome/common/spellcheck_messages.h" 27 #include "chrome/common/spellcheck_messages.h"
29 #include "chrome/common/translate_errors.h" 28 #include "chrome/common/translate_errors.h"
30 #include "chrome/common/url_constants.h" 29 #include "chrome/common/url_constants.h"
31 #include "content/browser/child_process_security_policy.h" 30 #include "content/browser/child_process_security_policy.h"
32 #include "content/browser/content_browser_client.h" 31 #include "content/browser/content_browser_client.h"
33 #include "content/browser/cross_site_request_manager.h" 32 #include "content/browser/cross_site_request_manager.h"
34 #include "content/browser/in_process_webkit/session_storage_namespace.h" 33 #include "content/browser/in_process_webkit/session_storage_namespace.h"
35 #include "content/browser/renderer_host/render_process_host.h" 34 #include "content/browser/renderer_host/render_process_host.h"
36 #include "content/browser/renderer_host/render_view_host_delegate.h" 35 #include "content/browser/renderer_host/render_view_host_delegate.h"
37 #include "content/browser/renderer_host/render_view_host_observer.h" 36 #include "content/browser/renderer_host/render_view_host_observer.h"
38 #include "content/browser/renderer_host/render_widget_host.h" 37 #include "content/browser/renderer_host/render_widget_host.h"
39 #include "content/browser/renderer_host/render_widget_host_view.h" 38 #include "content/browser/renderer_host/render_widget_host_view.h"
40 #include "content/browser/site_instance.h" 39 #include "content/browser/site_instance.h"
40 #include "content/common/bindings_policy.h"
41 #include "content/common/content_constants.h"
41 #include "content/common/drag_messages.h" 42 #include "content/common/drag_messages.h"
42 #include "content/common/native_web_keyboard_event.h" 43 #include "content/common/native_web_keyboard_event.h"
43 #include "content/common/notification_details.h" 44 #include "content/common/notification_details.h"
44 #include "content/common/notification_service.h" 45 #include "content/common/notification_service.h"
45 #include "content/common/notification_type.h" 46 #include "content/common/notification_type.h"
46 #include "content/common/result_codes.h" 47 #include "content/common/result_codes.h"
47 #include "content/common/view_messages.h" 48 #include "content/common/view_messages.h"
48 #include "net/base/net_util.h" 49 #include "net/base/net_util.h"
49 #include "net/url_request/url_request_context_getter.h" 50 #include "net/url_request/url_request_context_getter.h"
50 #include "third_party/skia/include/core/SkBitmap.h" 51 #include "third_party/skia/include/core/SkBitmap.h"
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 508
508 void RenderViewHost::InsertCSSInWebFrame( 509 void RenderViewHost::InsertCSSInWebFrame(
509 const std::wstring& frame_xpath, 510 const std::wstring& frame_xpath,
510 const std::string& css, 511 const std::string& css,
511 const std::string& id) { 512 const std::string& id) {
512 Send(new ViewMsg_CSSInsertRequest(routing_id(), frame_xpath, css, id)); 513 Send(new ViewMsg_CSSInsertRequest(routing_id(), frame_xpath, css, id));
513 } 514 }
514 515
515 void RenderViewHost::Undo() { 516 void RenderViewHost::Undo() {
516 Send(new ViewMsg_Undo(routing_id())); 517 Send(new ViewMsg_Undo(routing_id()));
518 UserMetrics::RecordAction(UserMetricsAction("Undo"));
517 } 519 }
518 520
519 void RenderViewHost::Redo() { 521 void RenderViewHost::Redo() {
520 Send(new ViewMsg_Redo(routing_id())); 522 Send(new ViewMsg_Redo(routing_id()));
523 UserMetrics::RecordAction(UserMetricsAction("Redo"));
521 } 524 }
522 525
523 void RenderViewHost::Cut() { 526 void RenderViewHost::Cut() {
524 Send(new ViewMsg_Cut(routing_id())); 527 Send(new ViewMsg_Cut(routing_id()));
528 UserMetrics::RecordAction(UserMetricsAction("Cut"));
525 } 529 }
526 530
527 void RenderViewHost::Copy() { 531 void RenderViewHost::Copy() {
528 Send(new ViewMsg_Copy(routing_id())); 532 Send(new ViewMsg_Copy(routing_id()));
533 UserMetrics::RecordAction(UserMetricsAction("Copy"));
529 } 534 }
530 535
531 void RenderViewHost::CopyToFindPboard() { 536 void RenderViewHost::CopyToFindPboard() {
532 #if defined(OS_MACOSX) 537 #if defined(OS_MACOSX)
533 // Windows/Linux don't have the concept of a find pasteboard. 538 // Windows/Linux don't have the concept of a find pasteboard.
534 Send(new ViewMsg_CopyToFindPboard(routing_id())); 539 Send(new ViewMsg_CopyToFindPboard(routing_id()));
540 UserMetrics::RecordAction(UserMetricsAction("CopyToFindPboard"));
535 #endif 541 #endif
536 } 542 }
537 543
538 void RenderViewHost::Paste() { 544 void RenderViewHost::Paste() {
539 Send(new ViewMsg_Paste(routing_id())); 545 Send(new ViewMsg_Paste(routing_id()));
546 UserMetrics::RecordAction(UserMetricsAction("Paste"));
540 } 547 }
541 548
542 void RenderViewHost::ToggleSpellCheck() { 549 void RenderViewHost::ToggleSpellCheck() {
543 Send(new SpellCheckMsg_ToggleSpellCheck(routing_id())); 550 Send(new SpellCheckMsg_ToggleSpellCheck(routing_id()));
544 } 551 }
545 552
546 void RenderViewHost::Delete() { 553 void RenderViewHost::Delete() {
547 Send(new ViewMsg_Delete(routing_id())); 554 Send(new ViewMsg_Delete(routing_id()));
555 UserMetrics::RecordAction(UserMetricsAction("DeleteSelection"));
548 } 556 }
549 557
550 void RenderViewHost::SelectAll() { 558 void RenderViewHost::SelectAll() {
551 Send(new ViewMsg_SelectAll(routing_id())); 559 Send(new ViewMsg_SelectAll(routing_id()));
560 UserMetrics::RecordAction(UserMetricsAction("SelectAll"));
552 } 561 }
553 562
554 void RenderViewHost::ToggleSpellPanel(bool is_currently_visible) { 563 void RenderViewHost::ToggleSpellPanel(bool is_currently_visible) {
555 Send(new SpellCheckMsg_ToggleSpellPanel(routing_id(), is_currently_visible)); 564 Send(new SpellCheckMsg_ToggleSpellPanel(routing_id(), is_currently_visible));
556 } 565 }
557 566
558 int RenderViewHost::DownloadFavicon(const GURL& url, int image_size) { 567 int RenderViewHost::DownloadFavicon(const GURL& url, int image_size) {
559 if (!url.is_valid()) { 568 if (!url.is_valid()) {
560 NOTREACHED(); 569 NOTREACHED();
561 return 0; 570 return 0;
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 delegate_->DidNavigate(this, validated_params); 993 delegate_->DidNavigate(this, validated_params);
985 } 994 }
986 995
987 void RenderViewHost::OnMsgUpdateState(int32 page_id, 996 void RenderViewHost::OnMsgUpdateState(int32 page_id,
988 const std::string& state) { 997 const std::string& state) {
989 delegate_->UpdateState(this, page_id, state); 998 delegate_->UpdateState(this, page_id, state);
990 } 999 }
991 1000
992 void RenderViewHost::OnMsgUpdateTitle(int32 page_id, 1001 void RenderViewHost::OnMsgUpdateTitle(int32 page_id,
993 const std::wstring& title) { 1002 const std::wstring& title) {
994 if (title.length() > chrome::kMaxTitleChars) { 1003 if (title.length() > content::kMaxTitleChars) {
995 NOTREACHED() << "Renderer sent too many characters in title."; 1004 NOTREACHED() << "Renderer sent too many characters in title.";
996 return; 1005 return;
997 } 1006 }
998 delegate_->UpdateTitle(this, page_id, title); 1007 delegate_->UpdateTitle(this, page_id, title);
999 } 1008 }
1000 1009
1001 void RenderViewHost::OnMsgUpdateEncoding(const std::string& encoding_name) { 1010 void RenderViewHost::OnMsgUpdateEncoding(const std::string& encoding_name) {
1002 delegate_->UpdateEncoding(this, encoding_name); 1011 delegate_->UpdateEncoding(this, encoding_name);
1003 } 1012 }
1004 1013
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 void RenderViewHost::OnMsgForwardMessageToExternalHost( 1151 void RenderViewHost::OnMsgForwardMessageToExternalHost(
1143 const std::string& message, const std::string& origin, 1152 const std::string& message, const std::string& origin,
1144 const std::string& target) { 1153 const std::string& target) {
1145 delegate_->ProcessExternalHostMessage(message, origin, target); 1154 delegate_->ProcessExternalHostMessage(message, origin, target);
1146 } 1155 }
1147 1156
1148 void RenderViewHost::DisassociateFromPopupCount() { 1157 void RenderViewHost::DisassociateFromPopupCount() {
1149 Send(new ViewMsg_DisassociateFromPopupCount(routing_id())); 1158 Send(new ViewMsg_DisassociateFromPopupCount(routing_id()));
1150 } 1159 }
1151 1160
1152 void RenderViewHost::AllowScriptToClose(bool script_can_close) {
1153 Send(new ViewMsg_AllowScriptToClose(routing_id(), script_can_close));
1154 }
1155
1156 void RenderViewHost::OnMsgSetTooltipText( 1161 void RenderViewHost::OnMsgSetTooltipText(
1157 const std::wstring& tooltip_text, 1162 const std::wstring& tooltip_text,
1158 WebTextDirection text_direction_hint) { 1163 WebTextDirection text_direction_hint) {
1159 // First, add directionality marks around tooltip text if necessary. 1164 // First, add directionality marks around tooltip text if necessary.
1160 // A naive solution would be to simply always wrap the text. However, on 1165 // A naive solution would be to simply always wrap the text. However, on
1161 // windows, Unicode directional embedding characters can't be displayed on 1166 // windows, Unicode directional embedding characters can't be displayed on
1162 // systems that lack RTL fonts and are instead displayed as empty squares. 1167 // systems that lack RTL fonts and are instead displayed as empty squares.
1163 // 1168 //
1164 // To get around this we only wrap the string when we deem it necessary i.e. 1169 // To get around this we only wrap the string when we deem it necessary i.e.
1165 // when the locale direction is different than the tooltip direction hint. 1170 // when the locale direction is different than the tooltip direction hint.
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 LOG(DFATAL) << "Invalid checked state " << checked_state; 1619 LOG(DFATAL) << "Invalid checked state " << checked_state;
1615 return; 1620 return;
1616 } 1621 }
1617 1622
1618 CommandState state; 1623 CommandState state;
1619 state.is_enabled = is_enabled; 1624 state.is_enabled = is_enabled;
1620 state.checked_state = 1625 state.checked_state =
1621 static_cast<RenderViewCommandCheckedState>(checked_state); 1626 static_cast<RenderViewCommandCheckedState>(checked_state);
1622 command_states_[static_cast<RenderViewCommand>(command)] = state; 1627 command_states_[static_cast<RenderViewCommand>(command)] = state;
1623 } 1628 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698