Chromium Code Reviews

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

Issue 5612005: Client-based geolocation support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on trunk Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 45 matching lines...)
56 #include "chrome/renderer/devtools_client.h" 56 #include "chrome/renderer/devtools_client.h"
57 #include "chrome/renderer/dom_ui_bindings.h" 57 #include "chrome/renderer/dom_ui_bindings.h"
58 #include "chrome/renderer/extension_groups.h" 58 #include "chrome/renderer/extension_groups.h"
59 #include "chrome/renderer/extensions/bindings_utils.h" 59 #include "chrome/renderer/extensions/bindings_utils.h"
60 #include "chrome/renderer/extensions/event_bindings.h" 60 #include "chrome/renderer/extensions/event_bindings.h"
61 #include "chrome/renderer/extensions/extension_process_bindings.h" 61 #include "chrome/renderer/extensions/extension_process_bindings.h"
62 #include "chrome/renderer/extensions/extension_renderer_info.h" 62 #include "chrome/renderer/extensions/extension_renderer_info.h"
63 #include "chrome/renderer/extensions/renderer_extension_bindings.h" 63 #include "chrome/renderer/extensions/renderer_extension_bindings.h"
64 #include "chrome/renderer/external_host_bindings.h" 64 #include "chrome/renderer/external_host_bindings.h"
65 #include "chrome/renderer/external_popup_menu.h" 65 #include "chrome/renderer/external_popup_menu.h"
66 #if ENABLE_CLIENT_BASED_GEOLOCATION
67 #include "chrome/renderer/geolocation_dispatcher.h"
68 #else
66 #include "chrome/renderer/geolocation_dispatcher_old.h" 69 #include "chrome/renderer/geolocation_dispatcher_old.h"
70 #endif
67 #include "chrome/renderer/ggl/ggl.h" 71 #include "chrome/renderer/ggl/ggl.h"
68 #include "chrome/renderer/localized_error.h" 72 #include "chrome/renderer/localized_error.h"
69 #include "chrome/renderer/media/audio_renderer_impl.h" 73 #include "chrome/renderer/media/audio_renderer_impl.h"
70 #include "chrome/renderer/media/ipc_video_decoder.h" 74 #include "chrome/renderer/media/ipc_video_decoder.h"
71 #include "chrome/renderer/navigation_state.h" 75 #include "chrome/renderer/navigation_state.h"
72 #include "chrome/renderer/notification_provider.h" 76 #include "chrome/renderer/notification_provider.h"
73 #include "chrome/renderer/page_click_tracker.h" 77 #include "chrome/renderer/page_click_tracker.h"
74 #include "chrome/renderer/page_load_histograms.h" 78 #include "chrome/renderer/page_load_histograms.h"
75 #include "chrome/renderer/password_autocomplete_manager.h" 79 #include "chrome/renderer/password_autocomplete_manager.h"
76 #include "chrome/renderer/plugin_channel_host.h" 80 #include "chrome/renderer/plugin_channel_host.h"
(...skipping 5535 matching lines...)
5612 5616
5613 void RenderView::OnPageTranslated() { 5617 void RenderView::OnPageTranslated() {
5614 WebFrame* frame = webview()->mainFrame(); 5618 WebFrame* frame = webview()->mainFrame();
5615 if (!frame) 5619 if (!frame)
5616 return; 5620 return;
5617 5621
5618 // The page is translated, so try to extract the form data again. 5622 // The page is translated, so try to extract the form data again.
5619 autofill_helper_->FrameContentsAvailable(frame); 5623 autofill_helper_->FrameContentsAvailable(frame);
5620 } 5624 }
5621 5625
5626 #if defined(ENABLE_CLIENT_BASED_GEOLOCATION)
5627 WebKit::WebGeolocationClient* RenderView::geolocationClient()
5628 {
5629 if (!geolocation_dispatcher_.get())
5630 geolocation_dispatcher_.reset(new GeolocationDispatcher(this));
5631 return geolocation_dispatcher_.get();
5632 }
5633 #else
5622 WebKit::WebGeolocationService* RenderView::geolocationService() { 5634 WebKit::WebGeolocationService* RenderView::geolocationService() {
5623 if (!geolocation_dispatcher_.get()) 5635 if (!geolocation_dispatcher_.get())
5624 geolocation_dispatcher_.reset(new GeolocationDispatcherOld(this)); 5636 geolocation_dispatcher_.reset(new GeolocationDispatcherOld(this));
5625 return geolocation_dispatcher_.get(); 5637 return geolocation_dispatcher_.get();
5626 } 5638 }
5639 #endif
5627 5640
5628 WebKit::WebSpeechInputController* RenderView::speechInputController( 5641 WebKit::WebSpeechInputController* RenderView::speechInputController(
5629 WebKit::WebSpeechInputListener* listener) { 5642 WebKit::WebSpeechInputListener* listener) {
5630 if (!speech_input_dispatcher_.get()) 5643 if (!speech_input_dispatcher_.get())
5631 speech_input_dispatcher_.reset(new SpeechInputDispatcher(this, listener)); 5644 speech_input_dispatcher_.reset(new SpeechInputDispatcher(this, listener));
5632 return speech_input_dispatcher_.get(); 5645 return speech_input_dispatcher_.get();
5633 } 5646 }
5634 5647
5635 WebKit::WebDeviceOrientationClient* RenderView::deviceOrientationClient() { 5648 WebKit::WebDeviceOrientationClient* RenderView::deviceOrientationClient() {
5636 if (!device_orientation_dispatcher_.get()) 5649 if (!device_orientation_dispatcher_.get())
(...skipping 96 matching lines...)
5733 external_popup_menu_.reset(); 5746 external_popup_menu_.reset();
5734 } 5747 }
5735 #endif 5748 #endif
5736 5749
5737 void RenderView::AddErrorToRootConsole(const string16& message) { 5750 void RenderView::AddErrorToRootConsole(const string16& message) {
5738 if (webview() && webview()->mainFrame()) { 5751 if (webview() && webview()->mainFrame()) {
5739 webview()->mainFrame()->addMessageToConsole( 5752 webview()->mainFrame()->addMessageToConsole(
5740 WebConsoleMessage(WebConsoleMessage::LevelError, message)); 5753 WebConsoleMessage(WebConsoleMessage::LevelError, message));
5741 } 5754 }
5742 } 5755 }
OLDNEW

Powered by Google App Engine