Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 23 matching lines...) Expand all Loading... | |
| 34 #include "chrome/common/extensions/extension_set.h" | 34 #include "chrome/common/extensions/extension_set.h" |
| 35 #include "chrome/common/json_value_serializer.h" | 35 #include "chrome/common/json_value_serializer.h" |
| 36 #include "chrome/common/pepper_plugin_registry.h" | 36 #include "chrome/common/pepper_plugin_registry.h" |
| 37 #include "chrome/common/render_messages.h" | 37 #include "chrome/common/render_messages.h" |
| 38 #include "chrome/common/render_view_commands.h" | 38 #include "chrome/common/render_view_commands.h" |
| 39 #include "chrome/common/spellcheck_messages.h" | 39 #include "chrome/common/spellcheck_messages.h" |
| 40 #include "chrome/common/thumbnail_score.h" | 40 #include "chrome/common/thumbnail_score.h" |
| 41 #include "chrome/common/url_constants.h" | 41 #include "chrome/common/url_constants.h" |
| 42 #include "chrome/common/web_apps.h" | 42 #include "chrome/common/web_apps.h" |
| 43 #include "chrome/renderer/about_handler.h" | 43 #include "chrome/renderer/about_handler.h" |
| 44 #include "chrome/renderer/autofill/autofill_agent.h" | |
| 45 #include "chrome/renderer/autofill/form_manager.h" | 44 #include "chrome/renderer/autofill/form_manager.h" |
| 46 #include "chrome/renderer/autofill/password_autofill_manager.h" | |
| 47 #include "chrome/renderer/automation/dom_automation_controller.h" | 45 #include "chrome/renderer/automation/dom_automation_controller.h" |
| 48 #include "chrome/renderer/devtools_agent.h" | |
| 49 #include "chrome/renderer/devtools_client.h" | 46 #include "chrome/renderer/devtools_client.h" |
| 50 #include "chrome/renderer/extension_groups.h" | 47 #include "chrome/renderer/extension_groups.h" |
| 51 #include "chrome/renderer/extensions/bindings_utils.h" | 48 #include "chrome/renderer/extensions/bindings_utils.h" |
| 52 #include "chrome/renderer/extensions/event_bindings.h" | 49 #include "chrome/renderer/extensions/event_bindings.h" |
| 53 #include "chrome/renderer/extensions/extension_helper.h" | |
| 54 #include "chrome/renderer/extensions/extension_process_bindings.h" | 50 #include "chrome/renderer/extensions/extension_process_bindings.h" |
| 55 #include "chrome/renderer/extensions/extension_resource_request_policy.h" | 51 #include "chrome/renderer/extensions/extension_resource_request_policy.h" |
| 56 #include "chrome/renderer/extensions/renderer_extension_bindings.h" | 52 #include "chrome/renderer/extensions/renderer_extension_bindings.h" |
| 57 #include "chrome/renderer/external_host_bindings.h" | 53 #include "chrome/renderer/external_host_bindings.h" |
| 58 #include "chrome/renderer/localized_error.h" | 54 #include "chrome/renderer/localized_error.h" |
| 59 #include "chrome/renderer/page_click_tracker.h" | |
| 60 #include "chrome/renderer/page_load_histograms.h" | 55 #include "chrome/renderer/page_load_histograms.h" |
| 61 #include "chrome/renderer/print_web_view_helper.h" | |
| 62 #include "chrome/renderer/render_process.h" | 56 #include "chrome/renderer/render_process.h" |
| 63 #include "chrome/renderer/render_thread.h" | 57 #include "chrome/renderer/render_thread.h" |
| 64 #include "chrome/renderer/safe_browsing/malware_dom_details.h" | |
| 65 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" | |
| 66 #include "chrome/renderer/searchbox.h" | |
| 67 #include "chrome/renderer/spellchecker/spellcheck.h" | 58 #include "chrome/renderer/spellchecker/spellcheck.h" |
| 68 #include "chrome/renderer/spellchecker/spellcheck_provider.h" | |
| 69 #include "chrome/renderer/translate_helper.h" | 59 #include "chrome/renderer/translate_helper.h" |
| 70 #include "chrome/renderer/user_script_idle_scheduler.h" | 60 #include "chrome/renderer/user_script_idle_scheduler.h" |
| 71 #include "chrome/renderer/user_script_slave.h" | 61 #include "chrome/renderer/user_script_slave.h" |
| 72 #include "chrome/renderer/visitedlink_slave.h" | 62 #include "chrome/renderer/visitedlink_slave.h" |
| 73 #include "content/common/appcache/appcache_dispatcher.h" | 63 #include "content/common/appcache/appcache_dispatcher.h" |
| 74 #include "content/common/clipboard_messages.h" | 64 #include "content/common/clipboard_messages.h" |
| 75 #include "content/common/content_constants.h" | 65 #include "content/common/content_constants.h" |
| 76 #include "content/common/database_messages.h" | 66 #include "content/common/database_messages.h" |
| 77 #include "content/common/drag_messages.h" | 67 #include "content/common/drag_messages.h" |
| 78 #include "content/common/file_system/file_system_dispatcher.h" | 68 #include "content/common/file_system/file_system_dispatcher.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 270 using WebKit::WebURLError; | 260 using WebKit::WebURLError; |
| 271 using WebKit::WebURLRequest; | 261 using WebKit::WebURLRequest; |
| 272 using WebKit::WebURLResponse; | 262 using WebKit::WebURLResponse; |
| 273 using WebKit::WebVector; | 263 using WebKit::WebVector; |
| 274 using WebKit::WebView; | 264 using WebKit::WebView; |
| 275 using WebKit::WebWidget; | 265 using WebKit::WebWidget; |
| 276 using WebKit::WebWindowFeatures; | 266 using WebKit::WebWindowFeatures; |
| 277 using WebKit::WebWorker; | 267 using WebKit::WebWorker; |
| 278 using WebKit::WebWorkerClient; | 268 using WebKit::WebWorkerClient; |
| 279 using appcache::WebApplicationCacheHostImpl; | 269 using appcache::WebApplicationCacheHostImpl; |
| 280 using autofill::AutofillAgent; | |
| 281 using autofill::FormManager; | 270 using autofill::FormManager; |
| 282 using autofill::PasswordAutofillManager; | |
| 283 using base::Time; | 271 using base::Time; |
| 284 using base::TimeDelta; | 272 using base::TimeDelta; |
| 285 using webkit_glue::AltErrorPageResourceFetcher; | 273 using webkit_glue::AltErrorPageResourceFetcher; |
| 286 using webkit_glue::FormData; | 274 using webkit_glue::FormData; |
| 287 using webkit_glue::FormField; | 275 using webkit_glue::FormField; |
| 288 using webkit_glue::ImageResourceFetcher; | 276 using webkit_glue::ImageResourceFetcher; |
| 289 using webkit_glue::PasswordForm; | 277 using webkit_glue::PasswordForm; |
| 290 using webkit_glue::PasswordFormDomManager; | 278 using webkit_glue::PasswordFormDomManager; |
| 291 using webkit_glue::ResourceFetcher; | 279 using webkit_glue::ResourceFetcher; |
| 292 using webkit_glue::SiteIsolationMetrics; | 280 using webkit_glue::SiteIsolationMetrics; |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 508 PendingFileChooser(const ViewHostMsg_RunFileChooser_Params& p, | 496 PendingFileChooser(const ViewHostMsg_RunFileChooser_Params& p, |
| 509 WebFileChooserCompletion* c) | 497 WebFileChooserCompletion* c) |
| 510 : params(p), | 498 : params(p), |
| 511 completion(c) { | 499 completion(c) { |
| 512 } | 500 } |
| 513 ViewHostMsg_RunFileChooser_Params params; | 501 ViewHostMsg_RunFileChooser_Params params; |
| 514 WebFileChooserCompletion* completion; // MAY BE NULL to skip callback. | 502 WebFileChooserCompletion* completion; // MAY BE NULL to skip callback. |
| 515 }; | 503 }; |
| 516 | 504 |
| 517 RenderView::RenderView(RenderThreadBase* render_thread, | 505 RenderView::RenderView(RenderThreadBase* render_thread, |
| 518 gfx::NativeViewId parent_hwnd, | |
| 519 int32 opener_id, | |
| 520 const RendererPreferences& renderer_prefs, | |
| 521 const WebPreferences& webkit_prefs, | 506 const WebPreferences& webkit_prefs, |
| 522 SharedRenderViewCounter* counter, | 507 SharedRenderViewCounter* counter, |
| 523 int32 routing_id, | 508 int32 routing_id, |
| 524 int64 session_storage_namespace_id, | 509 int64 session_storage_namespace_id) |
| 525 const string16& frame_name) | |
| 526 : RenderWidget(render_thread, WebKit::WebPopupTypeNone), | 510 : RenderWidget(render_thread, WebKit::WebPopupTypeNone), |
| 527 webkit_preferences_(webkit_prefs), | 511 webkit_preferences_(webkit_prefs), |
| 528 send_content_state_immediately_(false), | 512 send_content_state_immediately_(false), |
| 529 enabled_bindings_(0), | 513 enabled_bindings_(0), |
| 530 send_preferred_size_changes_(false), | 514 send_preferred_size_changes_(false), |
| 531 script_can_close_(true), | 515 script_can_close_(true), |
| 532 is_loading_(false), | 516 is_loading_(false), |
| 533 navigation_gesture_(NavigationGestureUnknown), | 517 navigation_gesture_(NavigationGestureUnknown), |
| 534 opened_by_user_gesture_(true), | 518 opened_by_user_gesture_(true), |
| 535 opener_suppressed_(false), | 519 opener_suppressed_(false), |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 549 view_type_(ViewType::INVALID), | 533 view_type_(ViewType::INVALID), |
| 550 browser_window_id_(-1), | 534 browser_window_id_(-1), |
| 551 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)), | 535 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)), |
| 552 ALLOW_THIS_IN_INITIALIZER_LIST(page_info_method_factory_(this)), | 536 ALLOW_THIS_IN_INITIALIZER_LIST(page_info_method_factory_(this)), |
| 553 ALLOW_THIS_IN_INITIALIZER_LIST(accessibility_method_factory_(this)), | 537 ALLOW_THIS_IN_INITIALIZER_LIST(accessibility_method_factory_(this)), |
| 554 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), | 538 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), |
| 555 devtools_client_(NULL), | 539 devtools_client_(NULL), |
| 556 geolocation_dispatcher_(NULL), | 540 geolocation_dispatcher_(NULL), |
| 557 speech_input_dispatcher_(NULL), | 541 speech_input_dispatcher_(NULL), |
| 558 device_orientation_dispatcher_(NULL), | 542 device_orientation_dispatcher_(NULL), |
| 559 print_helper_(NULL), | |
| 560 searchbox_(NULL), | |
| 561 spellcheck_provider_(NULL), | |
| 562 accessibility_ack_pending_(false), | 543 accessibility_ack_pending_(false), |
| 563 p2p_socket_dispatcher_(NULL), | 544 p2p_socket_dispatcher_(NULL), |
| 564 pending_app_icon_requests_(0), | 545 pending_app_icon_requests_(0), |
| 565 session_storage_namespace_id_(session_storage_namespace_id) { | 546 session_storage_namespace_id_(session_storage_namespace_id) { |
| 566 | 547 |
| 567 ClearBlockedContentSettings(); | 548 ClearBlockedContentSettings(); |
| 568 | 549 |
| 569 routing_id_ = routing_id; | 550 routing_id_ = routing_id; |
| 570 if (opener_id != MSG_ROUTING_NONE) | |
| 571 opener_id_ = opener_id; | |
| 572 | 551 |
| 573 if (counter) { | 552 if (counter) { |
| 574 shared_popup_counter_ = counter; | 553 shared_popup_counter_ = counter; |
| 575 shared_popup_counter_->data++; | 554 shared_popup_counter_->data++; |
| 576 decrement_shared_popup_at_destruction_ = true; | 555 decrement_shared_popup_at_destruction_ = true; |
| 577 } else { | 556 } else { |
| 578 shared_popup_counter_ = new SharedRenderViewCounter(0); | 557 shared_popup_counter_ = new SharedRenderViewCounter(0); |
| 579 decrement_shared_popup_at_destruction_ = false; | 558 decrement_shared_popup_at_destruction_ = false; |
| 580 } | 559 } |
| 581 | 560 |
| 582 notification_provider_ = new NotificationProvider(this); | 561 notification_provider_ = new NotificationProvider(this); |
| 562 } | |
| 583 | 563 |
| 584 devtools_agent_ = new DevToolsAgent(this); | 564 void RenderView::Init(gfx::NativeViewId parent_hwnd, |
| 585 PasswordAutofillManager* password_autofill_manager = | 565 int32 opener_id, |
| 586 new PasswordAutofillManager(this); | 566 const RendererPreferences& renderer_prefs, |
| 587 AutofillAgent* autofill_agent = new AutofillAgent(this, | 567 const string16& frame_name, |
| 588 password_autofill_manager); | 568 WebKit::WebAutoFillClient* autofill_agent, |
| 589 | 569 WebKit::WebDevToolsAgentClient* devtools_agent) { |
| 590 webwidget_ = WebView::create(this, devtools_agent_, autofill_agent); | 570 webwidget_ = WebView::create(this, devtools_agent, autofill_agent); |
| 591 g_view_map.Get().insert(std::make_pair(webview(), this)); | 571 g_view_map.Get().insert(std::make_pair(webview(), this)); |
| 592 webkit_preferences_.Apply(webview()); | 572 webkit_preferences_.Apply(webview()); |
| 593 webview()->initializeMainFrame(this); | 573 webview()->initializeMainFrame(this); |
| 594 if (!frame_name.empty()) | 574 if (!frame_name.empty()) |
| 595 webview()->mainFrame()->setName(frame_name); | 575 webview()->mainFrame()->setName(frame_name); |
| 596 webview()->settings()->setMinimumTimerInterval( | 576 webview()->settings()->setMinimumTimerInterval( |
| 597 is_hidden() ? webkit_glue::kBackgroundTabTimerInterval : | 577 is_hidden() ? webkit_glue::kBackgroundTabTimerInterval : |
| 598 webkit_glue::kForegroundTabTimerInterval); | 578 webkit_glue::kForegroundTabTimerInterval); |
| 599 | 579 |
| 600 OnSetRendererPrefs(renderer_prefs); | 580 OnSetRendererPrefs(renderer_prefs); |
| 601 | 581 |
| 602 render_thread_->AddRoute(routing_id_, this); | 582 render_thread_->AddRoute(routing_id_, this); |
| 603 // Take a reference on behalf of the RenderThread. This will be balanced | 583 // Take a reference on behalf of the RenderThread. This will be balanced |
| 604 // when we receive ViewMsg_Close. | 584 // when we receive ViewMsg_Close. |
| 605 AddRef(); | 585 AddRef(); |
| 606 | 586 |
| 607 // If this is a popup, we must wait for the CreatingNew_ACK message before | 587 // If this is a popup, we must wait for the CreatingNew_ACK message before |
| 608 // completing initialization. Otherwise, we can finish it now. | 588 // completing initialization. Otherwise, we can finish it now. |
| 609 if (opener_id == MSG_ROUTING_NONE) { | 589 if (opener_id == MSG_ROUTING_NONE) { |
| 610 did_show_ = true; | 590 did_show_ = true; |
| 611 CompleteInit(parent_hwnd); | 591 CompleteInit(parent_hwnd); |
| 592 } else { | |
| 593 opener_id_ = opener_id; | |
| 612 } | 594 } |
| 613 | 595 |
| 614 host_window_ = parent_hwnd; | 596 host_window_ = parent_hwnd; |
| 615 | 597 |
| 616 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 598 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 617 if (command_line.HasSwitch(switches::kDomAutomationController)) | 599 if (command_line.HasSwitch(switches::kDomAutomationController)) |
| 618 enabled_bindings_ |= BindingsPolicy::DOM_AUTOMATION; | 600 enabled_bindings_ |= BindingsPolicy::DOM_AUTOMATION; |
| 619 if (command_line.HasSwitch(switches::kEnableAccessibility)) | 601 if (command_line.HasSwitch(switches::kEnableAccessibility)) |
| 620 WebAccessibilityCache::enableAccessibility(); | 602 WebAccessibilityCache::enableAccessibility(); |
| 621 | 603 |
| 622 audio_message_filter_ = new AudioMessageFilter(routing_id_); | 604 audio_message_filter_ = new AudioMessageFilter(routing_id_); |
| 623 render_thread_->AddFilter(audio_message_filter_); | 605 render_thread_->AddFilter(audio_message_filter_); |
| 624 | 606 |
| 625 PageClickTracker* page_click_tracker = new PageClickTracker(this); | |
| 626 // Note that the order of insertion of the listeners is important. | |
| 627 // The password_autocomplete_manager takes the first shot at processing the | |
| 628 // notification and can stop the propagation. | |
| 629 page_click_tracker->AddListener(password_autofill_manager); | |
| 630 page_click_tracker->AddListener(autofill_agent); | |
| 631 new TranslateHelper(this); | |
| 632 print_helper_ = new PrintWebViewHelper(this); | |
| 633 searchbox_ = new SearchBox(this); | |
| 634 | |
| 635 RenderThread* current_thread = RenderThread::current(); | |
| 636 SpellCheck* spellcheck = current_thread ? current_thread->spellchecker() : 0; | |
| 637 spellcheck_provider_ = new SpellCheckProvider(this, spellcheck); | |
| 638 | |
| 639 if (CommandLine::ForCurrentProcess()->HasSwitch( | 607 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 640 switches::kEnableP2PApi)) { | 608 switches::kEnableP2PApi)) { |
| 641 p2p_socket_dispatcher_ = new P2PSocketDispatcher(this); | 609 p2p_socket_dispatcher_ = new P2PSocketDispatcher(this); |
| 642 } | 610 } |
| 643 | |
| 644 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
| 645 switches::kEnableClientSidePhishingDetection)) { | |
| 646 new safe_browsing::PhishingClassifierDelegate(this, NULL); | |
| 647 } | |
| 648 | |
| 649 // Observer for Malware DOM details messages. | |
| 650 new safe_browsing::MalwareDOMDetails(this); | |
| 651 | |
| 652 new ExtensionHelper(this); | |
| 653 } | 611 } |
| 654 | 612 |
| 655 RenderView::~RenderView() { | 613 RenderView::~RenderView() { |
| 656 if (decrement_shared_popup_at_destruction_) | 614 if (decrement_shared_popup_at_destruction_) |
| 657 shared_popup_counter_->data--; | 615 shared_popup_counter_->data--; |
| 658 | 616 |
| 659 // If file chooser is still waiting for answer, dispatch empty answer. | 617 // If file chooser is still waiting for answer, dispatch empty answer. |
| 660 while (!file_chooser_completions_.empty()) { | 618 while (!file_chooser_completions_.empty()) { |
| 661 if (file_chooser_completions_.front()->completion) { | 619 if (file_chooser_completions_.front()->completion) { |
| 662 file_chooser_completions_.front()->completion->didChooseFile( | 620 file_chooser_completions_.front()->completion->didChooseFile( |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 704 } | 662 } |
| 705 | 663 |
| 706 /*static*/ | 664 /*static*/ |
| 707 RenderView* RenderView::FromWebView(WebView* webview) { | 665 RenderView* RenderView::FromWebView(WebView* webview) { |
| 708 ViewMap* views = g_view_map.Pointer(); | 666 ViewMap* views = g_view_map.Pointer(); |
| 709 ViewMap::iterator it = views->find(webview); | 667 ViewMap::iterator it = views->find(webview); |
| 710 return it == views->end() ? NULL : it->second; | 668 return it == views->end() ? NULL : it->second; |
| 711 } | 669 } |
| 712 | 670 |
| 713 /*static*/ | 671 /*static*/ |
| 714 RenderView* RenderView::Create( | 672 RenderView* RenderView::Create(RenderThreadBase* render_thread, |
| 715 RenderThreadBase* render_thread, | 673 const WebPreferences& webkit_prefs, |
| 716 gfx::NativeViewId parent_hwnd, | 674 SharedRenderViewCounter* counter, |
| 717 int32 opener_id, | 675 int32 routing_id, |
| 718 const RendererPreferences& renderer_prefs, | 676 int64 session_storage_namespace_id) { |
| 719 const WebPreferences& webkit_prefs, | |
| 720 SharedRenderViewCounter* counter, | |
| 721 int32 routing_id, | |
| 722 int64 session_storage_namespace_id, | |
| 723 const string16& frame_name) { | |
| 724 DCHECK(routing_id != MSG_ROUTING_NONE); | 677 DCHECK(routing_id != MSG_ROUTING_NONE); |
| 725 return new RenderView( | 678 return new RenderView( |
| 726 render_thread, | 679 render_thread, |
| 727 parent_hwnd, | |
| 728 opener_id, | |
| 729 renderer_prefs, | |
| 730 webkit_prefs, | 680 webkit_prefs, |
| 731 counter, | 681 counter, |
| 732 routing_id, | 682 routing_id, |
| 733 session_storage_namespace_id, | 683 session_storage_namespace_id); // adds reference |
| 734 frame_name); // adds reference | |
| 735 } | 684 } |
| 736 | 685 |
| 737 // static | 686 // static |
| 738 void RenderView::SetNextPageID(int32 next_page_id) { | 687 void RenderView::SetNextPageID(int32 next_page_id) { |
| 739 // This method should only be called during process startup, and the given | 688 // This method should only be called during process startup, and the given |
| 740 // page id had better not exceed our current next page id! | 689 // page id had better not exceed our current next page id! |
| 741 DCHECK_EQ(next_page_id_, 1); | 690 DCHECK_EQ(next_page_id_, 1); |
| 742 DCHECK(next_page_id >= next_page_id_); | 691 DCHECK(next_page_id >= next_page_id_); |
| 743 next_page_id_ = next_page_id; | 692 next_page_id_ = next_page_id; |
| 744 } | 693 } |
| (...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1993 bool opener_suppressed = creator->willSuppressOpenerInNewFrame(); | 1942 bool opener_suppressed = creator->willSuppressOpenerInNewFrame(); |
| 1994 | 1943 |
| 1995 render_thread_->Send( | 1944 render_thread_->Send( |
| 1996 new ViewHostMsg_CreateWindow(params, | 1945 new ViewHostMsg_CreateWindow(params, |
| 1997 &routing_id, | 1946 &routing_id, |
| 1998 &cloned_session_storage_namespace_id)); | 1947 &cloned_session_storage_namespace_id)); |
| 1999 if (routing_id == MSG_ROUTING_NONE) | 1948 if (routing_id == MSG_ROUTING_NONE) |
| 2000 return NULL; | 1949 return NULL; |
| 2001 | 1950 |
| 2002 RenderView* view = RenderView::Create(render_thread_, | 1951 RenderView* view = RenderView::Create(render_thread_, |
| 2003 0, | |
| 2004 routing_id_, | |
| 2005 renderer_preferences_, | |
| 2006 webkit_preferences_, | 1952 webkit_preferences_, |
| 2007 shared_popup_counter_, | 1953 shared_popup_counter_, |
| 2008 routing_id, | 1954 routing_id, |
| 2009 cloned_session_storage_namespace_id, | 1955 cloned_session_storage_namespace_id); |
| 2010 frame_name); | 1956 view->Init(0, |
| 1957 routing_id_, | |
| 1958 renderer_preferences_, | |
| 1959 frame_name, | |
| 1960 NULL, | |
| 1961 NULL); | |
| 2011 view->opened_by_user_gesture_ = params.user_gesture; | 1962 view->opened_by_user_gesture_ = params.user_gesture; |
| 2012 | 1963 |
| 2013 // Record whether the creator frame is trying to suppress the opener field. | 1964 // Record whether the creator frame is trying to suppress the opener field. |
| 2014 view->opener_suppressed_ = opener_suppressed; | 1965 view->opener_suppressed_ = opener_suppressed; |
| 2015 | 1966 |
| 2016 // Record the security origin of the creator. | 1967 // Record the security origin of the creator. |
| 2017 GURL creator_url(creator->securityOrigin().toString().utf8()); | 1968 GURL creator_url(creator->securityOrigin().toString().utf8()); |
| 2018 if (!creator_url.is_valid() || !creator_url.IsStandard()) | 1969 if (!creator_url.is_valid() || !creator_url.IsStandard()) |
| 2019 creator_url = GURL(); | 1970 creator_url = GURL(); |
| 2020 view->creator_url_ = creator_url; | 1971 view->creator_url_ = creator_url; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2069 | 2020 |
| 2070 void RenderView::didAddMessageToConsole( | 2021 void RenderView::didAddMessageToConsole( |
| 2071 const WebConsoleMessage& message, const WebString& source_name, | 2022 const WebConsoleMessage& message, const WebString& source_name, |
| 2072 unsigned source_line) { | 2023 unsigned source_line) { |
| 2073 Send(new ViewHostMsg_AddMessageToConsole(routing_id_, | 2024 Send(new ViewHostMsg_AddMessageToConsole(routing_id_, |
| 2074 UTF16ToWideHack(message.text), | 2025 UTF16ToWideHack(message.text), |
| 2075 static_cast<int32>(source_line), | 2026 static_cast<int32>(source_line), |
| 2076 UTF16ToWideHack(source_name))); | 2027 UTF16ToWideHack(source_name))); |
| 2077 } | 2028 } |
| 2078 | 2029 |
| 2079 void RenderView::printPage(WebFrame* frame) { | 2030 void RenderView::printPage(WebKit::WebFrame* frame) { |
| 2080 print_helper_->ScriptInitiatedPrint(frame); | 2031 FOR_EACH_OBSERVER(RenderViewObserver, observers_, printPage(frame)); |
| 2081 } | 2032 } |
| 2082 | 2033 |
| 2083 WebKit::WebNotificationPresenter* RenderView::notificationPresenter() { | 2034 WebKit::WebNotificationPresenter* RenderView::notificationPresenter() { |
| 2084 return notification_provider_; | 2035 return notification_provider_; |
| 2085 } | 2036 } |
| 2086 | 2037 |
| 2087 void RenderView::didStartLoading() { | 2038 void RenderView::didStartLoading() { |
| 2088 if (is_loading_) { | 2039 if (is_loading_) { |
| 2089 DLOG(WARNING) << "didStartLoading called while loading"; | 2040 DLOG(WARNING) << "didStartLoading called while loading"; |
| 2090 return; | 2041 return; |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2250 if (thread) { | 2201 if (thread) { |
| 2251 thread->spellchecker()->SpellCheckWord( | 2202 thread->spellchecker()->SpellCheckWord( |
| 2252 word.c_str(), word.size(), document_tag_, | 2203 word.c_str(), word.size(), document_tag_, |
| 2253 &misspelled_offset, &misspelled_length, NULL); | 2204 &misspelled_offset, &misspelled_length, NULL); |
| 2254 } | 2205 } |
| 2255 } | 2206 } |
| 2256 | 2207 |
| 2257 void RenderView::requestCheckingOfText( | 2208 void RenderView::requestCheckingOfText( |
| 2258 const WebString& text, | 2209 const WebString& text, |
| 2259 WebKit::WebTextCheckingCompletion* completion) { | 2210 WebKit::WebTextCheckingCompletion* completion) { |
| 2260 spellcheck_provider_->RequestTextChecking(text, document_tag_, completion); | 2211 FOR_EACH_OBSERVER(RenderViewObserver, |
| 2212 observers_, | |
| 2213 RequestTextChecking(text, document_tag_, completion)); | |
|
jam
2011/03/29 18:31:59
http://codereview.chromium.org/6764001/ removes th
Lei Zhang
2011/03/30 22:05:43
Right, but we still have the spellcheck_provider_
| |
| 2261 } | 2214 } |
| 2262 | 2215 |
| 2263 WebString RenderView::autoCorrectWord(const WebKit::WebString& word) { | 2216 WebString RenderView::autoCorrectWord(const WebKit::WebString& word) { |
| 2264 string16 autocorrect_word; | 2217 string16 autocorrect_word; |
| 2265 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 2218 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 2266 if (command_line.HasSwitch(switches::kExperimentalSpellcheckerFeatures)) { | 2219 if (command_line.HasSwitch(switches::kExperimentalSpellcheckerFeatures)) { |
| 2267 EnsureDocumentTag(); | 2220 EnsureDocumentTag(); |
| 2268 RenderThread* thread = RenderThread::current(); | 2221 RenderThread* thread = RenderThread::current(); |
| 2269 // Will be NULL during unit tests. | 2222 // Will be NULL during unit tests. |
| 2270 if (thread) { | 2223 if (thread) { |
| (...skipping 3103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5374 const webkit_glue::CustomContextMenuContext& custom_context) { | 5327 const webkit_glue::CustomContextMenuContext& custom_context) { |
| 5375 if (custom_context.is_pepper_menu) | 5328 if (custom_context.is_pepper_menu) |
| 5376 pepper_delegate_.OnContextMenuClosed(custom_context); | 5329 pepper_delegate_.OnContextMenuClosed(custom_context); |
| 5377 else | 5330 else |
| 5378 context_menu_node_.reset(); | 5331 context_menu_node_.reset(); |
| 5379 } | 5332 } |
| 5380 | 5333 |
| 5381 void RenderView::OnNetworkStateChanged(bool online) { | 5334 void RenderView::OnNetworkStateChanged(bool online) { |
| 5382 WebNetworkStateNotifier::setOnLine(online); | 5335 WebNetworkStateNotifier::setOnLine(online); |
| 5383 } | 5336 } |
| OLD | NEW |