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

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

Issue 6390006: Create autofill subdirectory in chrome/renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile Created 9 years, 10 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 "chrome/renderer/render_view.h" 5 #include "chrome/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 29 matching lines...) Expand all
40 #include "chrome/common/pepper_messages.h" 40 #include "chrome/common/pepper_messages.h"
41 #include "chrome/common/pepper_plugin_registry.h" 41 #include "chrome/common/pepper_plugin_registry.h"
42 #include "chrome/common/render_messages.h" 42 #include "chrome/common/render_messages.h"
43 #include "chrome/common/renderer_preferences.h" 43 #include "chrome/common/renderer_preferences.h"
44 #include "chrome/common/thumbnail_score.h" 44 #include "chrome/common/thumbnail_score.h"
45 #include "chrome/common/url_constants.h" 45 #include "chrome/common/url_constants.h"
46 #include "chrome/common/web_apps.h" 46 #include "chrome/common/web_apps.h"
47 #include "chrome/common/window_container_type.h" 47 #include "chrome/common/window_container_type.h"
48 #include "chrome/renderer/about_handler.h" 48 #include "chrome/renderer/about_handler.h"
49 #include "chrome/renderer/audio_message_filter.h" 49 #include "chrome/renderer/audio_message_filter.h"
50 #include "chrome/renderer/autofill_helper.h" 50 #include "chrome/renderer/autofill/autofill_agent.h"
51 #include "chrome/renderer/autofill/form_manager.h"
52 #include "chrome/renderer/autofill/password_autofill_manager.h"
51 #include "chrome/renderer/automation/dom_automation_controller.h" 53 #include "chrome/renderer/automation/dom_automation_controller.h"
52 #include "chrome/renderer/blocked_plugin.h" 54 #include "chrome/renderer/blocked_plugin.h"
53 #include "chrome/renderer/device_orientation_dispatcher.h" 55 #include "chrome/renderer/device_orientation_dispatcher.h"
54 #include "chrome/renderer/devtools_agent.h" 56 #include "chrome/renderer/devtools_agent.h"
55 #include "chrome/renderer/devtools_client.h" 57 #include "chrome/renderer/devtools_client.h"
56 #include "chrome/renderer/dom_ui_bindings.h" 58 #include "chrome/renderer/dom_ui_bindings.h"
57 #include "chrome/renderer/extension_groups.h" 59 #include "chrome/renderer/extension_groups.h"
58 #include "chrome/renderer/extensions/bindings_utils.h" 60 #include "chrome/renderer/extensions/bindings_utils.h"
59 #include "chrome/renderer/extensions/event_bindings.h" 61 #include "chrome/renderer/extensions/event_bindings.h"
60 #include "chrome/renderer/extensions/extension_process_bindings.h" 62 #include "chrome/renderer/extensions/extension_process_bindings.h"
61 #include "chrome/renderer/extensions/extension_renderer_info.h" 63 #include "chrome/renderer/extensions/extension_renderer_info.h"
62 #include "chrome/renderer/extensions/renderer_extension_bindings.h" 64 #include "chrome/renderer/extensions/renderer_extension_bindings.h"
63 #include "chrome/renderer/external_host_bindings.h" 65 #include "chrome/renderer/external_host_bindings.h"
64 #include "chrome/renderer/external_popup_menu.h" 66 #include "chrome/renderer/external_popup_menu.h"
65 #include "chrome/renderer/geolocation_dispatcher.h" 67 #include "chrome/renderer/geolocation_dispatcher.h"
66 #include "chrome/renderer/ggl/ggl.h" 68 #include "chrome/renderer/ggl/ggl.h"
67 #include "chrome/renderer/load_progress_tracker.h" 69 #include "chrome/renderer/load_progress_tracker.h"
68 #include "chrome/renderer/localized_error.h" 70 #include "chrome/renderer/localized_error.h"
69 #include "chrome/renderer/media/audio_renderer_impl.h" 71 #include "chrome/renderer/media/audio_renderer_impl.h"
70 #include "chrome/renderer/media/ipc_video_decoder.h" 72 #include "chrome/renderer/media/ipc_video_decoder.h"
71 #include "chrome/renderer/navigation_state.h" 73 #include "chrome/renderer/navigation_state.h"
72 #include "chrome/renderer/notification_provider.h" 74 #include "chrome/renderer/notification_provider.h"
73 #include "chrome/renderer/page_click_tracker.h" 75 #include "chrome/renderer/page_click_tracker.h"
74 #include "chrome/renderer/page_load_histograms.h" 76 #include "chrome/renderer/page_load_histograms.h"
75 #include "chrome/renderer/password_autocomplete_manager.h"
76 #include "chrome/renderer/plugin_channel_host.h" 77 #include "chrome/renderer/plugin_channel_host.h"
77 #include "chrome/renderer/print_web_view_helper.h" 78 #include "chrome/renderer/print_web_view_helper.h"
78 #include "chrome/renderer/render_process.h" 79 #include "chrome/renderer/render_process.h"
79 #include "chrome/renderer/render_thread.h" 80 #include "chrome/renderer/render_thread.h"
80 #include "chrome/renderer/render_view_observer.h" 81 #include "chrome/renderer/render_view_observer.h"
81 #include "chrome/renderer/render_view_visitor.h" 82 #include "chrome/renderer/render_view_visitor.h"
82 #include "chrome/renderer/render_widget_fullscreen.h" 83 #include "chrome/renderer/render_widget_fullscreen.h"
83 #include "chrome/renderer/render_widget_fullscreen_pepper.h" 84 #include "chrome/renderer/render_widget_fullscreen_pepper.h"
84 #include "chrome/renderer/renderer_webapplicationcachehost_impl.h" 85 #include "chrome/renderer/renderer_webapplicationcachehost_impl.h"
85 #include "chrome/renderer/renderer_webstoragenamespace_impl.h" 86 #include "chrome/renderer/renderer_webstoragenamespace_impl.h"
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 shared_popup_counter_->data++; 598 shared_popup_counter_->data++;
598 decrement_shared_popup_at_destruction_ = true; 599 decrement_shared_popup_at_destruction_ = true;
599 } else { 600 } else {
600 shared_popup_counter_ = new SharedRenderViewCounter(0); 601 shared_popup_counter_ = new SharedRenderViewCounter(0);
601 decrement_shared_popup_at_destruction_ = false; 602 decrement_shared_popup_at_destruction_ = false;
602 } 603 }
603 604
604 notification_provider_ = new NotificationProvider(this); 605 notification_provider_ = new NotificationProvider(this);
605 606
606 devtools_agent_ = new DevToolsAgent(this); 607 devtools_agent_ = new DevToolsAgent(this);
607 PasswordAutocompleteManager* password_autocomplete_manager = 608 autofill::PasswordAutoFillManager* password_autofill_manager =
608 new PasswordAutocompleteManager(this); 609 new autofill::PasswordAutoFillManager(this);
609 AutoFillHelper* autofill_helper = new AutoFillHelper( 610 autofill::AutoFillAgent* autofill_agent = new autofill::AutoFillAgent(
610 this, password_autocomplete_manager); 611 this, password_autofill_manager);
611 612
612 webwidget_ = WebView::create(this, devtools_agent_, autofill_helper); 613 webwidget_ = WebView::create(this, devtools_agent_, autofill_agent);
613 g_view_map.Get().insert(std::make_pair(webview(), this)); 614 g_view_map.Get().insert(std::make_pair(webview(), this));
614 webkit_preferences_.Apply(webview()); 615 webkit_preferences_.Apply(webview());
615 webview()->initializeMainFrame(this); 616 webview()->initializeMainFrame(this);
616 if (!frame_name.empty()) 617 if (!frame_name.empty())
617 webview()->mainFrame()->setName(frame_name); 618 webview()->mainFrame()->setName(frame_name);
618 619
619 OnSetRendererPrefs(renderer_prefs); 620 OnSetRendererPrefs(renderer_prefs);
620 621
621 render_thread_->AddRoute(routing_id_, this); 622 render_thread_->AddRoute(routing_id_, this);
622 // Take a reference on behalf of the RenderThread. This will be balanced 623 // Take a reference on behalf of the RenderThread. This will be balanced
(...skipping 15 matching lines...) Expand all
638 if (command_line.HasSwitch(switches::kEnableAccessibility)) 639 if (command_line.HasSwitch(switches::kEnableAccessibility))
639 WebAccessibilityCache::enableAccessibility(); 640 WebAccessibilityCache::enableAccessibility();
640 641
641 audio_message_filter_ = new AudioMessageFilter(routing_id_); 642 audio_message_filter_ = new AudioMessageFilter(routing_id_);
642 render_thread_->AddFilter(audio_message_filter_); 643 render_thread_->AddFilter(audio_message_filter_);
643 644
644 PageClickTracker* page_click_tracker = new PageClickTracker(this); 645 PageClickTracker* page_click_tracker = new PageClickTracker(this);
645 // Note that the order of insertion of the listeners is important. 646 // Note that the order of insertion of the listeners is important.
646 // The password_autocomplete_manager takes the first shot at processing the 647 // The password_autocomplete_manager takes the first shot at processing the
647 // notification and can stop the propagation. 648 // notification and can stop the propagation.
648 page_click_tracker->AddListener(password_autocomplete_manager); 649 page_click_tracker->AddListener(password_autofill_manager);
649 page_click_tracker->AddListener(autofill_helper); 650 page_click_tracker->AddListener(autofill_agent);
650 } 651 }
651 652
652 RenderView::~RenderView() { 653 RenderView::~RenderView() {
653 if (decrement_shared_popup_at_destruction_) 654 if (decrement_shared_popup_at_destruction_)
654 shared_popup_counter_->data--; 655 shared_popup_counter_->data--;
655 656
656 // If file chooser is still waiting for answer, dispatch empty answer. 657 // If file chooser is still waiting for answer, dispatch empty answer.
657 while (!file_chooser_completions_.empty()) { 658 while (!file_chooser_completions_.empty()) {
658 if (file_chooser_completions_.front()->completion) { 659 if (file_chooser_completions_.front()->completion) {
659 file_chooser_completions_.front()->completion->didChooseFile( 660 file_chooser_completions_.front()->completion->didChooseFile(
(...skipping 2475 matching lines...) Expand 10 before | Expand all | Expand 10 after
3135 NavigationState* old_navigation_state = 3136 NavigationState* old_navigation_state =
3136 NavigationState::FromDataSource(frame->dataSource()); 3137 NavigationState::FromDataSource(frame->dataSource());
3137 if (old_navigation_state) { 3138 if (old_navigation_state) {
3138 PasswordForm* old_form_data = old_navigation_state->password_form_data(); 3139 PasswordForm* old_form_data = old_navigation_state->password_form_data();
3139 if (old_form_data && old_form_data->action == password_form_data->action) 3140 if (old_form_data && old_form_data->action == password_form_data->action)
3140 password_form_data->password_value = old_form_data->password_value; 3141 password_form_data->password_value = old_form_data->password_value;
3141 } 3142 }
3142 } 3143 }
3143 3144
3144 FormData form_data; 3145 FormData form_data;
3145 if (FormManager::WebFormElementToFormData( 3146 if (autofill::FormManager::WebFormElementToFormData(
3146 form, 3147 form,
3147 FormManager::REQUIRE_AUTOCOMPLETE, 3148 autofill::FormManager::REQUIRE_AUTOCOMPLETE,
3148 static_cast<FormManager::ExtractMask>(FormManager::EXTRACT_VALUE | 3149 static_cast<autofill::FormManager::ExtractMask>(
3149 FormManager::EXTRACT_OPTION_TEXT), 3150 autofill::FormManager::EXTRACT_VALUE |
3151 autofill::FormManager::EXTRACT_OPTION_TEXT),
3150 &form_data)) { 3152 &form_data)) {
3151 Send(new AutoFillHostMsg_FormSubmitted(routing_id_, form_data)); 3153 Send(new AutoFillHostMsg_FormSubmitted(routing_id_, form_data));
3152 } 3154 }
3153 } 3155 }
3154 3156
3155 void RenderView::willPerformClientRedirect( 3157 void RenderView::willPerformClientRedirect(
3156 WebFrame* frame, const WebURL& from, const WebURL& to, double interval, 3158 WebFrame* frame, const WebURL& from, const WebURL& to, double interval,
3157 double fire_time) { 3159 double fire_time) {
3158 // Ignore 3160 // Ignore
3159 } 3161 }
(...skipping 2606 matching lines...) Expand 10 before | Expand all | Expand 10 after
5766 if (cmd == kJavaScriptStressTestSetStressRunType) { 5768 if (cmd == kJavaScriptStressTestSetStressRunType) {
5767 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); 5769 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param));
5768 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { 5770 } else if (cmd == kJavaScriptStressTestPrepareStressRun) {
5769 v8::Testing::PrepareStressRun(param); 5771 v8::Testing::PrepareStressRun(param);
5770 } 5772 }
5771 } 5773 }
5772 5774
5773 void RenderView::OnContextMenuClosed() { 5775 void RenderView::OnContextMenuClosed() {
5774 context_menu_node_.reset(); 5776 context_menu_node_.reset();
5775 } 5777 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698