diff options
author | saintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-20 21:20:33 +0000 |
---|---|---|
committer | saintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-20 21:20:33 +0000 |
commit | 9edeb71c75df9eed63d4e27e90c2ddfc287049b8 (patch) | |
tree | 219f94803f3193301e3d606693bb7d1a74ab2264 | |
parent | 20960e074cf789825155f771e1c035df41cd0e75 (diff) | |
download | chromium_src-9edeb71c75df9eed63d4e27e90c2ddfc287049b8.zip chromium_src-9edeb71c75df9eed63d4e27e90c2ddfc287049b8.tar.gz chromium_src-9edeb71c75df9eed63d4e27e90c2ddfc287049b8.tar.bz2 |
Making TOOLKIT_USES_GTK orthogonal to USE_AURA.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/7973003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102019 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | build/common.gypi | 14 | ||||
-rw-r--r-- | chrome/browser/chrome_browser_main_posix.cc | 4 | ||||
-rw-r--r-- | chrome/browser/profiles/profile.cc | 4 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_widget_host_view_views.cc | 4 | ||||
-rw-r--r-- | chrome/browser/renderer_preferences_util.cc | 10 | ||||
-rw-r--r-- | chrome/browser/themes/theme_service.h | 2 | ||||
-rw-r--r-- | chrome/browser/themes/theme_service_factory.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/views/frame/browser_view.cc | 4 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 30 | ||||
-rw-r--r-- | content/browser/gpu/gpu_process_host.cc | 16 | ||||
-rw-r--r-- | content/browser/gpu/gpu_process_host.h | 2 | ||||
-rw-r--r-- | content/browser/renderer_host/render_widget_host.cc | 4 | ||||
-rw-r--r-- | content/content_browser.gypi | 3 |
13 files changed, 35 insertions, 66 deletions
diff --git a/build/common.gypi b/build/common.gypi index f46ba16..d2666c4 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -235,18 +235,20 @@ 'os_posix%': 1, }], - # Flags to use Gtk and X11 on non-Mac POSIX platforms + # Flag to use X11 on non-Mac POSIX platforms ['OS=="win" or OS=="mac" or OS=="android"', { - 'toolkit_uses_gtk%': 0, 'use_x11%': 0, }, { - # TODO(dnicoara) Wayland build should have these disabled, but - # currently GTK and X is too spread and it's hard to completely - # remove every dependency. - 'toolkit_uses_gtk%': 1, 'use_x11%': 1, }], + # Flag to use Gtk on non-Aura and non-Mac POSIX platforms + ['OS=="win" or OS=="mac" or OS=="android" or use_aura==1', { + 'toolkit_uses_gtk%': 0, + }, { + 'toolkit_uses_gtk%': 1, + }], + # A flag to enable or disable our compile-time dependency # on gnome-keyring. If that dependency is disabled, no gnome-keyring # support will be available. This option is useful diff --git a/chrome/browser/chrome_browser_main_posix.cc b/chrome/browser/chrome_browser_main_posix.cc index 518d8ecf..aa54aec 100644 --- a/chrome/browser/chrome_browser_main_posix.cc +++ b/chrome/browser/chrome_browser_main_posix.cc @@ -20,7 +20,7 @@ #include "chrome/common/chrome_switches.h" #include "content/browser/browser_thread.h" -#if defined(TOOLKIT_USES_GTK) && !defined(OS_CHROMEOS) && !defined(USE_AURA) +#if defined(TOOLKIT_USES_GTK) && !defined(OS_CHROMEOS) #include "chrome/browser/printing/print_dialog_gtk.h" #endif @@ -255,7 +255,7 @@ void ChromeBrowserMainPartsPosix::PostMainMessageLoopStart() { action.sa_handler = SIGHUPHandler; CHECK(sigaction(SIGHUP, &action, NULL) == 0); -#if defined(TOOLKIT_USES_GTK) && !defined(OS_CHROMEOS) && !defined(USE_AURA) +#if defined(TOOLKIT_USES_GTK) && !defined(OS_CHROMEOS) printing::PrintingContextCairo::SetCreatePrintDialogFunction( &PrintDialogGtk::CreatePrintDialog); #endif diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc index b59fe42..13fb35f 100644 --- a/chrome/browser/profiles/profile.cc +++ b/chrome/browser/profiles/profile.cc @@ -62,7 +62,7 @@ #include "webkit/database/database_tracker.h" #include "webkit/quota/quota_manager.h" -#if defined(TOOLKIT_USES_GTK) && !defined(USE_AURA) +#if defined(TOOLKIT_USES_GTK) #include "chrome/browser/ui/gtk/gtk_theme_service.h" #endif @@ -140,7 +140,7 @@ void Profile::RegisterUserPrefs(PrefService* prefs) { prefs->RegisterBooleanPref(prefs::kSpeechInputCensorResults, true, PrefService::UNSYNCABLE_PREF); -#if defined(TOOLKIT_USES_GTK) & !defined(USE_AURA) +#if defined(TOOLKIT_USES_GTK) prefs->RegisterBooleanPref(prefs::kUsesSystemTheme, GtkThemeService::DefaultUsesSystemTheme(), PrefService::UNSYNCABLE_PREF); diff --git a/chrome/browser/renderer_host/render_widget_host_view_views.cc b/chrome/browser/renderer_host/render_widget_host_view_views.cc index 7b35392..8808c4a 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_views.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_views.cc @@ -777,7 +777,7 @@ void RenderWidgetHostViewViews::OnPaint(gfx::Canvas* canvas) { paint_rect = paint_rect.Intersect(invalid_rect_); if (backing_store) { -#if defined(TOOLKIT_USES_GTK) && !defined(USE_AURA) +#if defined(TOOLKIT_USES_GTK) // Only render the widget if it is attached to a window; there's a short // period where this object isn't attached to a window but hasn't been // Destroy()ed yet and it receives paint messages... @@ -797,7 +797,7 @@ void RenderWidgetHostViewViews::OnPaint(gfx::Canvas* canvas) { // TODO(sad) NOTIMPLEMENTED(); } -#if defined(TOOLKIT_USES_GTK) && !defined(USE_AURA) +#if defined(TOOLKIT_USES_GTK) } #endif if (!whiteout_start_time_.is_null()) { diff --git a/chrome/browser/renderer_preferences_util.cc b/chrome/browser/renderer_preferences_util.cc index c37ea5d..a585d43 100644 --- a/chrome/browser/renderer_preferences_util.cc +++ b/chrome/browser/renderer_preferences_util.cc @@ -8,7 +8,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/common/pref_names.h" -#if defined(TOOLKIT_USES_GTK) && !defined(USE_AURA) +#if defined(TOOLKIT_USES_GTK) #include "chrome/browser/ui/gtk/gtk_theme_service.h" #include "chrome/browser/ui/gtk/gtk_util.h" #endif @@ -16,10 +16,10 @@ namespace renderer_preferences_util { void UpdateFromSystemSettings(RendererPreferences* prefs, Profile* profile) { -#if defined(TOOLKIT_USES_GTK) && !defined(USE_AURA) +#if defined(TOOLKIT_USES_GTK) gtk_util::UpdateGtkFontSettings(prefs); -#if !defined(OS_CHROMEOS) && !defined(USE_AURA) +#if !defined(OS_CHROMEOS) GtkThemeService* theme_service = GtkThemeService::GetFrom(profile); prefs->focus_ring_color = theme_service->get_focus_ring_color(); @@ -40,9 +40,9 @@ void UpdateFromSystemSettings(RendererPreferences* prefs, Profile* profile) { prefs->active_selection_fg_color = SK_ColorBLACK; prefs->inactive_selection_bg_color = SkColorSetRGB(0xEA, 0xEA, 0xEA); prefs->inactive_selection_fg_color = SK_ColorBLACK; -#endif // defined(OS_CHROMEOS) && defined(USE_AURA) +#endif // defined(OS_CHROMEOS) -#endif // defined(TOOLKIT_USES_GTK) && defined(USE_AURA) +#endif // defined(TOOLKIT_USES_GTK) prefs->enable_referrers = profile->GetPrefs()->GetBoolean(prefs::kEnableReferrers); diff --git a/chrome/browser/themes/theme_service.h b/chrome/browser/themes/theme_service.h index 861164c..4b8a3ca 100644 --- a/chrome/browser/themes/theme_service.h +++ b/chrome/browser/themes/theme_service.h @@ -147,7 +147,7 @@ class ThemeService : public base::NonThreadSafe, virtual bool ShouldUseNativeFrame() const; virtual bool HasCustomImage(int id) const; virtual RefCountedMemory* GetRawData(int id) const; -#if defined(TOOLKIT_USES_GTK) && !defined(USE_AURA) +#if defined(TOOLKIT_USES_GTK) // GdkPixbufs returned by GetPixbufNamed and GetRTLEnabledPixbufNamed are // shared instances owned by the theme provider and should not be freed. virtual GdkPixbuf* GetPixbufNamed(int id) const; diff --git a/chrome/browser/themes/theme_service_factory.cc b/chrome/browser/themes/theme_service_factory.cc index 21fa817..861614d 100644 --- a/chrome/browser/themes/theme_service_factory.cc +++ b/chrome/browser/themes/theme_service_factory.cc @@ -11,7 +11,7 @@ #include "chrome/browser/themes/theme_service.h" #include "content/common/notification_service.h" -#if defined(TOOLKIT_USES_GTK) && !defined(USE_AURA) +#if defined(TOOLKIT_USES_GTK) #include "chrome/browser/ui/gtk/gtk_theme_service.h" #endif @@ -45,7 +45,7 @@ ThemeServiceFactory::~ThemeServiceFactory() {} ProfileKeyedService* ThemeServiceFactory::BuildServiceInstanceFor( Profile* profile) const { ThemeService* provider = NULL; -#if defined(TOOLKIT_USES_GTK) && !defined(USE_AURA) +#if defined(TOOLKIT_USES_GTK) provider = new GtkThemeService; #else provider = new ThemeService; diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index a0580b3..8bdf6ad 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -1246,7 +1246,7 @@ bool BrowserView::PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, views::FocusManager* focus_manager = GetFocusManager(); DCHECK(focus_manager); -#if defined(TOOLKIT_USES_GTK) && !(defined(TOUCH_UI) || defined(USE_AURA)) +#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) // Views and WebKit use different tables for GdkEventKey -> views::KeyEvent // conversion. We need to use View's conversion table here to keep consistent // behavior with views::FocusManager::OnKeyEvent() method. @@ -1311,7 +1311,7 @@ bool BrowserView::PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, void BrowserView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { // TODO(ben): figure out why are these two code paths so different -#if defined(TOOLKIT_USES_GTK) && !(defined(TOUCH_UI) || defined(USE_AURA)) +#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) HandleWebKeyboardEvent(GetWidget(), event); #else unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index aa33877..de6795e 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -4952,43 +4952,13 @@ # Must remove GTK files in PureViews case ['use_aura==1 and OS=="linux"', { 'sources/': [ - ['exclude', '^browser/automation/testing_automation_provider_gtk.cc'], - ['exclude', '^browser/first_run/first_run_gtk.cc'], ['exclude', '^browser/google/google_update.cc'], ['exclude', '^browser/google/google_update.h'], ['exclude', '^browser/platform_util_common_linux.cc'], ['exclude', '^browser/platform_util_linux.cc'], - ['exclude', '^browser/printing/print_dialog_gtk.cc'], - ['exclude', '^browser/printing/print_dialog_gtk.h'], ['exclude', '^browser/process_singleton_linux.cc'], - ['exclude', '^browser/renderer_host/render_widget_host_view_gtk.cc'], - ['exclude', '^browser/renderer_host/render_widget_host_view_gtk.h'], - ['exclude', '^browser/screensaver_window_finder_gtk.cc'], - ['exclude', '^browser/screensaver_window_finder_gtk.h'], - ['exclude', '^browser/speech/speech_input_bubble_gtk.cc'], - ['exclude', '^browser/tab_contents/render_view_context_menu_gtk.cc'], - ['exclude', '^browser/tab_contents/render_view_context_menu_gtk.h'], - ['exclude', '^browser/tab_contents/tab_contents_view_gtk.cc'], - ['exclude', '^browser/tab_contents/tab_contents_view_gtk.h'], - ['exclude', '^browser/themes/theme_service_gtk.cc'], - ['exclude', '^browser/ui/gtk/*'], ['exclude', '^browser/ui/input_window_dialog.h'], - ['exclude', '^browser/ui/input_window_dialog_gtk.cc'], ['exclude', '^browser/ui/input_window_dialog_win.cc'], - ['exclude', '^browser/ui/login/login_prompt_gtk.cc'], - ['exclude', '^browser/ui/tabs/dock_info_gtk.cc'], - ['exclude', '^browser/ui/views/browser_bubble_gtk.cc'], - ['exclude', '^browser/ui/views/constrained_html_delegate_gtk.cc'], - ['exclude', '^browser/ui/views/dialog_stubs_gtk.cc'], - ['exclude', '^browser/ui/views/dropdown_bar_host_gtk.cc'], - ['exclude', '^browser/ui/views/frame/browser_frame_gtk.cc'], - ['exclude', '^browser/ui/views/frame/browser_frame_gtk.h'], - ['exclude', '^browser/ui/views/handle_web_keyboard_event_gtk.cc'], - ['exclude', '^browser/ui/views/tab_contents/native_tab_contents_container_gtk.cc'], - ['exclude', '^browser/ui/views/tab_contents/native_tab_contents_container_gtk.h'], - ['exclude', '^browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc'], - ['exclude', '^browser/ui/views/tab_contents/native_tab_contents_view_gtk.h'], - ['exclude', '^browser/ui/window_sizer_gtk.cc'], ['include', '^browser/ui/login/login_prompt_ui.cc'], ['include', '^browser/ui/views/aura/aura_init.cc'], ['include', '^browser/ui/views/browser_bubble_aura.cc'], diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index 02141fe..d1a24b5 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc @@ -59,7 +59,7 @@ static const int kGpuMaxCrashCount = 3; int g_last_host_id = 0; -#if defined(TOOLKIT_USES_GTK) && !defined(USE_AURA) +#if defined(TOOLKIT_USES_GTK) class ReleasePermanentXIDDispatcher: public Task { public: @@ -95,7 +95,7 @@ void SendGpuProcessMessage(int renderer_id, } // anonymous namespace -#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) && !defined(USE_AURA) +#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) // Used to put a lock on surfaces so that the window to which the GPU // process is drawing to doesn't disappear while it is drawing when // a tab is closed. @@ -120,7 +120,7 @@ GpuProcessHost::SurfaceRef::~SurfaceRef() { FROM_HERE, new ReleasePermanentXIDDispatcher(surface_)); } -#endif // defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) && !defined(USE_AURA) +#endif // defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) // This class creates a GPU thread (instead of a GPU process), when running // with --in-process-gpu or --single-process. @@ -371,7 +371,7 @@ void GpuProcessHost::CreateViewCommandBuffer( DCHECK(CalledOnValidThread()); linked_ptr<CreateCommandBufferCallback> wrapped_callback(callback); -#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) && !defined(USE_AURA) +#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) ViewID view_id(renderer_id, render_view_id); // There should only be one such command buffer (for the compositor). In @@ -384,13 +384,13 @@ void GpuProcessHost::CreateViewCommandBuffer( surface_ref = (*it).second; else surface_ref.reset(new SurfaceRef(compositing_surface)); -#endif // defined(TOOLKIT_USES_GTK) && defined(TOUCH_UI) && !defined(USE_AURA) +#endif // defined(TOOLKIT_USES_GTK) && defined(TOUCH_UI) if (compositing_surface != gfx::kNullPluginWindow && Send(new GpuMsg_CreateViewCommandBuffer( compositing_surface, render_view_id, renderer_id, init_params))) { create_command_buffer_requests_.push(wrapped_callback); -#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) && !defined(USE_AURA) +#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) surface_refs_.insert(std::pair<ViewID, linked_ptr<SurfaceRef> >( view_id, surface_ref)); #endif @@ -443,12 +443,12 @@ void GpuProcessHost::OnCommandBufferCreated(const int32 route_id) { void GpuProcessHost::OnDestroyCommandBuffer( gfx::PluginWindowHandle window, int32 renderer_id, int32 render_view_id) { -#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) && !defined(USE_AURA) +#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) ViewID view_id(renderer_id, render_view_id); SurfaceRefMap::iterator it = surface_refs_.find(view_id); if (it != surface_refs_.end()) surface_refs_.erase(it); -#endif // defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) && !defined(USE_AURA) +#endif // defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) } void GpuProcessHost::OnGraphicsInfoCollected(const GPUInfo& gpu_info) { diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h index 15ce84d..b337176 100644 --- a/content/browser/gpu/gpu_process_host.h +++ b/content/browser/gpu/gpu_process_host.h @@ -123,7 +123,7 @@ class GpuProcessHost : public BrowserChildProcessHost, std::queue<linked_ptr<CreateCommandBufferCallback> > create_command_buffer_requests_; -#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) && !defined(USE_AURA) +#if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) typedef std::pair<int32 /* renderer_id */, int32 /* render_view_id */> ViewID; diff --git a/content/browser/renderer_host/render_widget_host.cc b/content/browser/renderer_host/render_widget_host.cc index cca84f5..3cd4a46 100644 --- a/content/browser/renderer_host/render_widget_host.cc +++ b/content/browser/renderer_host/render_widget_host.cc @@ -204,7 +204,7 @@ bool RenderWidgetHost::OnMessageReceived(const IPC::Message &msg) { IPC_MESSAGE_HANDLER(ViewHostMsg_AcceleratedSurfaceBuffersSwapped, OnAcceleratedSurfaceBuffersSwapped) #endif -#if defined(TOOLKIT_USES_GTK) && !defined(USE_AURA) +#if defined(TOOLKIT_USES_GTK) IPC_MESSAGE_HANDLER(ViewHostMsg_CreatePluginContainer, OnMsgCreatePluginContainer) IPC_MESSAGE_HANDLER(ViewHostMsg_DestroyPluginContainer, @@ -1105,7 +1105,7 @@ void RenderWidgetHost::OnMsgDidActivateAcceleratedCompositing(bool activated) { #elif defined(OS_WIN) if (view_) view_->ShowCompositorHostWindow(is_accelerated_compositing_active_); -#elif defined(TOOLKIT_USES_GTK) && !defined(USE_AURA) +#elif defined(TOOLKIT_USES_GTK) if (view_) view_->AcceleratedCompositingActivated(activated); #endif diff --git a/content/content_browser.gypi b/content/content_browser.gypi index 4e6c6d1..9912b20 100644 --- a/content/content_browser.gypi +++ b/content/content_browser.gypi @@ -626,9 +626,6 @@ ['exclude', '^browser/renderer_host/gtk_im_context_wrapper.cc'], ['exclude', '^browser/renderer_host/gtk_im_context_wrapper.h'], ['exclude', '^browser/renderer_host/render_widget_host.h'], - ['exclude', '^browser/renderer_host/render_widget_host_gtk.cc'], - ['exclude', '^browser/renderer_host/render_widget_host_view_gtk.cc'], - ['exclude', '^browser/renderer_host/render_widget_host_view_gtk.h'], ['exclude', '^browser/renderer_host/render_widget_host_view_win.cc'], ['exclude', '^browser/renderer_host/render_widget_host_view_win.h'], ['exclude', '^browser/renderer_host/render_message_filter_win.cc'], |