diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-31 22:35:31 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-31 22:35:31 +0000 |
commit | daf82f8e54e875ad6e97aef6952ef181de65caeb (patch) | |
tree | aec8a0a0117e8fac930ef5ca64773891a26e7e88 /chrome | |
parent | c0a53a20b6e12ccf95d5c0c255c3987ae281cb5d (diff) | |
download | chromium_src-daf82f8e54e875ad6e97aef6952ef181de65caeb.zip chromium_src-daf82f8e54e875ad6e97aef6952ef181de65caeb.tar.gz chromium_src-daf82f8e54e875ad6e97aef6952ef181de65caeb.tar.bz2 |
Move RendererPreferences to content/public/common and also put in the content namespace.
BUG=76697
Review URL: http://codereview.chromium.org/8432011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108025 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/extensions/extension_host.cc | 4 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_host.h | 2 | ||||
-rw-r--r-- | chrome/browser/instant/instant_loader.cc | 1 | ||||
-rw-r--r-- | chrome/browser/notifications/balloon_host.cc | 6 | ||||
-rw-r--r-- | chrome/browser/notifications/balloon_host.h | 3 | ||||
-rw-r--r-- | chrome/browser/renderer_preferences_util.cc | 4 | ||||
-rw-r--r-- | chrome/browser/renderer_preferences_util.h | 9 | ||||
-rw-r--r-- | chrome/browser/tab_contents/background_contents.cc | 4 | ||||
-rw-r--r-- | chrome/browser/tab_contents/background_contents.h | 2 | ||||
-rw-r--r-- | chrome/browser/tab_contents/chrome_interstitial_page.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/gtk/gtk_util.cc | 31 | ||||
-rw-r--r-- | chrome/browser/ui/gtk/gtk_util.h | 7 | ||||
-rw-r--r-- | chrome/test/base/chrome_render_view_test.cc | 2 |
13 files changed, 44 insertions, 33 deletions
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc index 717816c..8b2eba1 100644 --- a/chrome/browser/extensions/extension_host.cc +++ b/chrome/browser/extensions/extension_host.cc @@ -510,10 +510,10 @@ void ExtensionHost::Close(RenderViewHost* render_view_host) { } } -RendererPreferences ExtensionHost::GetRendererPrefs( +content::RendererPreferences ExtensionHost::GetRendererPrefs( content::BrowserContext* browser_context) const { Profile* profile = Profile::FromBrowserContext(browser_context); - RendererPreferences preferences; + content::RendererPreferences preferences; TabContents* associated_contents = GetAssociatedTabContents(); if (associated_contents) diff --git a/chrome/browser/extensions/extension_host.h b/chrome/browser/extensions/extension_host.h index 9777dda..0adc57d 100644 --- a/chrome/browser/extensions/extension_host.h +++ b/chrome/browser/extensions/extension_host.h @@ -139,7 +139,7 @@ class ExtensionHost : public RenderViewHostDelegate, IPC::Message* reply_msg, bool* did_suppress_message) OVERRIDE; virtual void Close(RenderViewHost* render_view_host) OVERRIDE; - virtual RendererPreferences GetRendererPrefs( + virtual content::RendererPreferences GetRendererPrefs( content::BrowserContext* browser_context) const OVERRIDE; virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) OVERRIDE; diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc index 143ceff..363ae45 100644 --- a/chrome/browser/instant/instant_loader.cc +++ b/chrome/browser/instant/instant_loader.cc @@ -39,7 +39,6 @@ #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_delegate.h" #include "content/browser/tab_contents/tab_contents_view.h" -#include "content/common/renderer_preferences.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/notifications/balloon_host.cc b/chrome/browser/notifications/balloon_host.cc index ca63c90..9109d15 100644 --- a/chrome/browser/notifications/balloon_host.cc +++ b/chrome/browser/notifications/balloon_host.cc @@ -18,10 +18,10 @@ #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/site_instance.h" #include "content/public/browser/notification_service.h" -#include "content/common/renderer_preferences.h" #include "content/common/view_messages.h" #include "content/public/browser/notification_source.h" #include "content/public/common/bindings_policy.h" +#include "content/public/common/renderer_preferences.h" #include "ipc/ipc_message.h" #include "webkit/glue/webpreferences.h" @@ -165,10 +165,10 @@ void BalloonHost::HandleMouseDown() { balloon_->OnClick(); } -RendererPreferences BalloonHost::GetRendererPrefs( +content::RendererPreferences BalloonHost::GetRendererPrefs( content::BrowserContext* browser_context) const { Profile* profile = Profile::FromBrowserContext(browser_context); - RendererPreferences preferences; + content::RendererPreferences preferences; renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile); return preferences; } diff --git a/chrome/browser/notifications/balloon_host.h b/chrome/browser/notifications/balloon_host.h index 3ad69f3..e55cefa 100644 --- a/chrome/browser/notifications/balloon_host.h +++ b/chrome/browser/notifications/balloon_host.h @@ -20,7 +20,6 @@ class Balloon; class Browser; class Profile; class SiteInstance; -struct RendererPreferences; struct WebPreferences; namespace IPC { @@ -60,7 +59,7 @@ class BalloonHost : public RenderViewHostDelegate, virtual content::ViewType GetRenderViewType() const OVERRIDE; virtual RenderViewHostDelegate::View* GetViewDelegate() OVERRIDE; virtual void HandleMouseDown() OVERRIDE; - virtual RendererPreferences GetRendererPrefs( + virtual content::RendererPreferences GetRendererPrefs( content::BrowserContext* browser_context) const OVERRIDE; virtual void UpdatePreferredSize(const gfx::Size& pref_size) OVERRIDE; diff --git a/chrome/browser/renderer_preferences_util.cc b/chrome/browser/renderer_preferences_util.cc index a585d43..4339473 100644 --- a/chrome/browser/renderer_preferences_util.cc +++ b/chrome/browser/renderer_preferences_util.cc @@ -7,6 +7,7 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/pref_names.h" +#include "content/public/common/renderer_preferences.h" #if defined(TOOLKIT_USES_GTK) #include "chrome/browser/ui/gtk/gtk_theme_service.h" @@ -15,7 +16,8 @@ namespace renderer_preferences_util { -void UpdateFromSystemSettings(RendererPreferences* prefs, Profile* profile) { +void UpdateFromSystemSettings( + content::RendererPreferences* prefs, Profile* profile) { #if defined(TOOLKIT_USES_GTK) gtk_util::UpdateGtkFontSettings(prefs); diff --git a/chrome/browser/renderer_preferences_util.h b/chrome/browser/renderer_preferences_util.h index ccca11a..e26da26 100644 --- a/chrome/browser/renderer_preferences_util.h +++ b/chrome/browser/renderer_preferences_util.h @@ -6,14 +6,17 @@ #define CHROME_BROWSER_RENDERER_PREFERENCES_UTIL_H_ #pragma once -#include "content/common/renderer_preferences.h" - class Profile; +namespace content { +struct RendererPreferences; +} + namespace renderer_preferences_util { // Copies system configuration preferences into |prefs|. -void UpdateFromSystemSettings(RendererPreferences* prefs, Profile* profile); +void UpdateFromSystemSettings(content::RendererPreferences* prefs, + Profile* profile); } // namespace renderer_preferences_util diff --git a/chrome/browser/tab_contents/background_contents.cc b/chrome/browser/tab_contents/background_contents.cc index 33af53f..ddbd45d 100644 --- a/chrome/browser/tab_contents/background_contents.cc +++ b/chrome/browser/tab_contents/background_contents.cc @@ -176,10 +176,10 @@ void BackgroundContents::RenderViewGone(RenderViewHost* rvh, delete this; } -RendererPreferences BackgroundContents::GetRendererPrefs( +content::RendererPreferences BackgroundContents::GetRendererPrefs( content::BrowserContext* browser_context) const { Profile* profile = Profile::FromBrowserContext(browser_context); - RendererPreferences preferences; + content::RendererPreferences preferences; renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile); return preferences; } diff --git a/chrome/browser/tab_contents/background_contents.h b/chrome/browser/tab_contents/background_contents.h index 8b78a27..90c49c1 100644 --- a/chrome/browser/tab_contents/background_contents.h +++ b/chrome/browser/tab_contents/background_contents.h @@ -75,7 +75,7 @@ class BackgroundContents : public RenderViewHostDelegate, IPC::Message* reply_msg, bool* did_suppress_message) OVERRIDE; virtual void Close(RenderViewHost* render_view_host) OVERRIDE; - virtual RendererPreferences GetRendererPrefs( + virtual content::RendererPreferences GetRendererPrefs( content::BrowserContext* browser_context) const OVERRIDE; virtual void RenderViewGone(RenderViewHost* rvh, base::TerminationStatus status, diff --git a/chrome/browser/tab_contents/chrome_interstitial_page.cc b/chrome/browser/tab_contents/chrome_interstitial_page.cc index d42a5eb..ce07ed9 100644 --- a/chrome/browser/tab_contents/chrome_interstitial_page.cc +++ b/chrome/browser/tab_contents/chrome_interstitial_page.cc @@ -17,7 +17,7 @@ ChromeInterstitialPage::ChromeInterstitialPage(TabContents* tab, const GURL& url) : InterstitialPage(tab, new_navigation, url) { Profile* profile = Profile::FromBrowserContext(tab->browser_context()); - RendererPreferences prefs; + content::RendererPreferences prefs; renderer_preferences_util::UpdateFromSystemSettings(&prefs, profile); set_renderer_preferences(prefs); } diff --git a/chrome/browser/ui/gtk/gtk_util.cc b/chrome/browser/ui/gtk/gtk_util.cc index cea5207..b5fa941 100644 --- a/chrome/browser/ui/gtk/gtk_util.cc +++ b/chrome/browser/ui/gtk/gtk_util.cc @@ -30,7 +30,7 @@ #include "content/browser/disposition_utils.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/tab_contents.h" -#include "content/common/renderer_preferences.h" +#include "content/public/common/renderer_preferences.h" #include "googleurl/src/gurl.h" #include "grit/theme_resources.h" #include "grit/theme_resources_standard.h" @@ -636,7 +636,7 @@ GtkWidget* IndentWidget(GtkWidget* content) { return content_alignment; } -void UpdateGtkFontSettings(RendererPreferences* prefs) { +void UpdateGtkFontSettings(content::RendererPreferences* prefs) { DCHECK(prefs); // From http://library.gnome.org/devel/gtk/unstable/GtkSettings.html, this is @@ -660,9 +660,9 @@ void UpdateGtkFontSettings(RendererPreferences* prefs) { // Set some reasonable defaults. prefs->should_antialias_text = true; - prefs->hinting = RENDERER_PREFERENCES_HINTING_SYSTEM_DEFAULT; + prefs->hinting = content::RENDERER_PREFERENCES_HINTING_SYSTEM_DEFAULT; prefs->subpixel_rendering = - RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT; + content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT; if (cursor_blink) { // Dividing by 2*1000ms follows the WebKit GTK port and makes the blink @@ -680,25 +680,30 @@ void UpdateGtkFontSettings(RendererPreferences* prefs) { prefs->should_antialias_text = antialias; if (hinting == 0 || strcmp(hint_style, "hintnone") == 0) { - prefs->hinting = RENDERER_PREFERENCES_HINTING_NONE; + prefs->hinting = content::RENDERER_PREFERENCES_HINTING_NONE; } else if (strcmp(hint_style, "hintslight") == 0) { - prefs->hinting = RENDERER_PREFERENCES_HINTING_SLIGHT; + prefs->hinting = content::RENDERER_PREFERENCES_HINTING_SLIGHT; } else if (strcmp(hint_style, "hintmedium") == 0) { - prefs->hinting = RENDERER_PREFERENCES_HINTING_MEDIUM; + prefs->hinting = content::RENDERER_PREFERENCES_HINTING_MEDIUM; } else if (strcmp(hint_style, "hintfull") == 0) { - prefs->hinting = RENDERER_PREFERENCES_HINTING_FULL; + prefs->hinting = content::RENDERER_PREFERENCES_HINTING_FULL; } if (strcmp(rgba_style, "none") == 0) { - prefs->subpixel_rendering = RENDERER_PREFERENCES_SUBPIXEL_RENDERING_NONE; + prefs->subpixel_rendering = + content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_NONE; } else if (strcmp(rgba_style, "rgb") == 0) { - prefs->subpixel_rendering = RENDERER_PREFERENCES_SUBPIXEL_RENDERING_RGB; + prefs->subpixel_rendering = + content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_RGB; } else if (strcmp(rgba_style, "bgr") == 0) { - prefs->subpixel_rendering = RENDERER_PREFERENCES_SUBPIXEL_RENDERING_BGR; + prefs->subpixel_rendering = + content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_BGR; } else if (strcmp(rgba_style, "vrgb") == 0) { - prefs->subpixel_rendering = RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VRGB; + prefs->subpixel_rendering = + content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VRGB; } else if (strcmp(rgba_style, "vbgr") == 0) { - prefs->subpixel_rendering = RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VBGR; + prefs->subpixel_rendering = + content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VBGR; } } diff --git a/chrome/browser/ui/gtk/gtk_util.h b/chrome/browser/ui/gtk/gtk_util.h index 6febcc4..7059d38 100644 --- a/chrome/browser/ui/gtk/gtk_util.h +++ b/chrome/browser/ui/gtk/gtk_util.h @@ -24,7 +24,10 @@ class BrowserWindow; class GtkThemeService; class GURL; class Profile; -struct RendererPreferences; // from common/renderer_preferences.h + +namespace content { +struct RendererPreferences; +} namespace event_utils { @@ -191,7 +194,7 @@ GtkWidget* IndentWidget(GtkWidget* content); // Sets (or resets) the font settings in |prefs| (used when creating new // renderers) based on GtkSettings (which itself comes from XSETTINGS). -void UpdateGtkFontSettings(RendererPreferences* prefs); +void UpdateGtkFontSettings(content::RendererPreferences* prefs); // Reverses a point in RTL mode. Used in making vectors of GdkPoints for window // shapes. diff --git a/chrome/test/base/chrome_render_view_test.cc b/chrome/test/base/chrome_render_view_test.cc index 98e5e68..926b86c 100644 --- a/chrome/test/base/chrome_render_view_test.cc +++ b/chrome/test/base/chrome_render_view_test.cc @@ -16,9 +16,9 @@ #include "chrome/renderer/extensions/extension_process_bindings.h" #include "chrome/renderer/extensions/renderer_extension_bindings.h" #include "content/common/dom_storage_common.h" -#include "content/common/renderer_preferences.h" #include "content/common/view_messages.h" #include "content/public/browser/native_web_keyboard_event.h" +#include "content/public/common/renderer_preferences.h" #include "content/renderer/render_view_impl.h" #include "content/renderer/renderer_main_platform_delegate.h" #include "content/test/mock_render_process.h" |