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

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 160084: Chaos geolocation demo, non-WebKit part. Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | chrome/browser/views/infobars/infobars.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.cc
===================================================================
--- chrome/browser/tab_contents/tab_contents.cc (revision 23543)
+++ chrome/browser/tab_contents/tab_contents.cc (working copy)
@@ -35,6 +35,7 @@
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/renderer_host/resource_request_details.h"
#include "chrome/browser/renderer_host/web_cache_manager.h"
+#include "chrome/browser/tab_contents/geoloc_infobar_delegate.h"
#include "chrome/browser/tab_contents/infobar_delegate.h"
#include "chrome/browser/tab_contents/interstitial_page.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
@@ -60,6 +61,7 @@
#include "net/base/net_errors.h"
#include "net/base/net_util.h"
#include "net/base/registry_controlled_domain.h"
+#include "webkit/chaos/GeolocationPowerbox.h"
#include "webkit/glue/password_form.h"
#include "webkit/glue/webpreferences.h"
@@ -2091,6 +2093,28 @@
view_->GetTopLevelNativeWindow(), NULL);
}
+void TabContents::ChooseGeolocationProvider(const GURL &url) {
+ WebCore::GeolocationPowerbox::ProviderId provider_id
+ = WebCore::GeolocationBrowserPowerbox::powerbox.findDecision(url);
+ if (provider_id
+ != WebCore::GeolocationPowerbox::NO_PROVIDER_FOUND) {
+ GeolocationProviderChosen(provider_id);
+ return;
+ }
+
+ geolocation_url_ = url;
+
+ LOG(WARNING) << "Pop up infobar";
+ AddInfoBar(new GeolocInfoBarDelegate(this));
+}
+
+void TabContents::GeolocationProviderChosen(
+ WebCore::GeolocationPowerbox::ProviderId provider_id) {
+ WebCore::GeolocationBrowserPowerbox::powerbox.addDecision(geolocation_url_,
+ provider_id);
+ render_view_host()->GeolocationProviderChosen(provider_id);
+}
+
void TabContents::RunJavaScriptMessage(
const std::wstring& message,
const std::wstring& default_prompt,
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | chrome/browser/views/infobars/infobars.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698