summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 17:31:27 +0000
committerjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 17:31:27 +0000
commitb12350654488c041c407d7aefd4d016e97c3e204 (patch)
tree28fe0a78bae8320e8051e3d469d082cf564c0dd4 /chrome
parent75393a5c79f92b579ff9535f6a22ee88f03365f5 (diff)
downloadchromium_src-b12350654488c041c407d7aefd4d016e97c3e204.zip
chromium_src-b12350654488c041c407d7aefd4d016e97c3e204.tar.gz
chromium_src-b12350654488c041c407d7aefd4d016e97c3e204.tar.bz2
Add Geolocation to the content types. This adds several special case guards so we can still build & run whilst the full implementation is being worked on (in parallel)
(Some code taken from http://codereview.chromium.org/650180) BUG=11246 TEST=Built & ran on all three platforms. Used geolocation & open content setting dialog. Review URL: http://codereview.chromium.org/1241006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42633 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/cocoa/content_blocked_bubble_controller.mm3
-rw-r--r--chrome/browser/gtk/options/content_exceptions_window_gtk.cc2
-rw-r--r--chrome/browser/gtk/options/content_settings_window_gtk.cc3
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc6
-rw-r--r--chrome/browser/views/options/content_settings_window_view.cc3
-rw-r--r--chrome/common/content_settings_types.h1
6 files changed, 16 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/content_blocked_bubble_controller.mm b/chrome/browser/cocoa/content_blocked_bubble_controller.mm
index b08929e..2011be24 100644
--- a/chrome/browser/cocoa/content_blocked_bubble_controller.mm
+++ b/chrome/browser/cocoa/content_blocked_bubble_controller.mm
@@ -94,6 +94,9 @@ NSString* ReplaceNSStringPlaceholders(NSString* formatString,
@"ContentBlockedJavaScript",
@"ContentBlockedPlugins",
@"ContentBlockedPopups",
+ // TODO(joth/thakis): Implement Geolocation. In the meantime, use
+ // another xib here to keep the unit test happy.
+ @"ContentBlockedCookies",
};
COMPILE_ASSERT(arraysize(nibPaths) == CONTENT_SETTINGS_NUM_TYPES,
nibPaths_requires_an_entry_for_every_setting_type);
diff --git a/chrome/browser/gtk/options/content_exceptions_window_gtk.cc b/chrome/browser/gtk/options/content_exceptions_window_gtk.cc
index 7cf9630..cd20544 100644
--- a/chrome/browser/gtk/options/content_exceptions_window_gtk.cc
+++ b/chrome/browser/gtk/options/content_exceptions_window_gtk.cc
@@ -42,6 +42,8 @@ void ContentExceptionsWindowGtk::ShowExceptionsWindow(
ContentSettingsType type) {
DCHECK(map);
DCHECK(type < CONTENT_SETTINGS_NUM_TYPES);
+ // TODO(joth): remove once fully implemented.
+ DCHECK(type != CONTENT_SETTINGS_TYPE_GEOLOCATION);
if (!instances[type]) {
// Create the options window.
diff --git a/chrome/browser/gtk/options/content_settings_window_gtk.cc b/chrome/browser/gtk/options/content_settings_window_gtk.cc
index 7e50a7c..82737389 100644
--- a/chrome/browser/gtk/options/content_settings_window_gtk.cc
+++ b/chrome/browser/gtk/options/content_settings_window_gtk.cc
@@ -114,8 +114,9 @@ ContentSettingsWindowGtk::ContentSettingsWindowGtk(GtkWindow* parent,
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog_)->vbox), notebook_);
+ // TODO(joth): remove -1 when geolocation tab is added.
DCHECK_EQ(gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook_)),
- CONTENT_SETTINGS_NUM_TYPES);
+ CONTENT_SETTINGS_NUM_TYPES - 1);
// Need to show the notebook before connecting switch-page signal, otherwise
// we'll immediately get a signal switching to page 0 and overwrite our
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 3c72815..83b6f55 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -622,6 +622,10 @@ bool TabContents::IsContentBlocked(ContentSettingsType content_type) const {
content_type == CONTENT_SETTINGS_TYPE_COOKIES)
return content_blocked_[content_type];
+ // TODO(joth): remove once fully implemented.
+ if (content_type == CONTENT_SETTINGS_TYPE_GEOLOCATION)
+ return false;
+
NOTREACHED();
return false;
}
@@ -2030,6 +2034,8 @@ void TabContents::DocumentLoadedInFrame() {
}
void TabContents::OnContentBlocked(ContentSettingsType type) {
+ // TODO(joth): remove once fully implemented.
+ DCHECK(type != CONTENT_SETTINGS_TYPE_GEOLOCATION);
content_blocked_[type] = true;
if (delegate_)
delegate_->OnBlockedContentChange(this);
diff --git a/chrome/browser/views/options/content_settings_window_view.cc b/chrome/browser/views/options/content_settings_window_view.cc
index 2a09034..dd5fabf 100644
--- a/chrome/browser/views/options/content_settings_window_view.cc
+++ b/chrome/browser/views/options/content_settings_window_view.cc
@@ -169,7 +169,8 @@ void ContentSettingsWindowView::Init() {
l10n_util::GetString(IDS_POPUP_TAB_LABEL),
popup_page, false);
- DCHECK_EQ(tabs_->GetTabCount(), CONTENT_SETTINGS_NUM_TYPES);
+ // TODO(joth): remove -1 when geolocation tab is added.
+ DCHECK_EQ(tabs_->GetTabCount(), CONTENT_SETTINGS_NUM_TYPES - 1);
}
const OptionsPageView*
diff --git a/chrome/common/content_settings_types.h b/chrome/common/content_settings_types.h
index 3eb8595..09b786b 100644
--- a/chrome/common/content_settings_types.h
+++ b/chrome/common/content_settings_types.h
@@ -16,6 +16,7 @@ enum ContentSettingsType {
CONTENT_SETTINGS_TYPE_JAVASCRIPT,
CONTENT_SETTINGS_TYPE_PLUGINS,
CONTENT_SETTINGS_TYPE_POPUPS,
+ CONTENT_SETTINGS_TYPE_GEOLOCATION,
CONTENT_SETTINGS_NUM_TYPES
};