diff options
36 files changed, 17 insertions, 715 deletions
diff --git a/apps/app_window_browsertest.cc b/apps/app_window_browsertest.cc index e79a6d4..22446a3 100644 --- a/apps/app_window_browsertest.cc +++ b/apps/app_window_browsertest.cc @@ -16,7 +16,7 @@ typedef extensions::PlatformAppBrowserTest AppWindowBrowserTest; // This test is disabled on Linux because of the unpredictable nature of native // windows. We cannot assume that the window manager will insert any title bar // at all, so the test may fail on certain window managers. -#if defined(TOOLKIT_GTK) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) #define MAYBE_FrameInsetsForDefaultFrame DISABLED_FrameInsetsForDefaultFrame #else #define MAYBE_FrameInsetsForDefaultFrame FrameInsetsForDefaultFrame @@ -39,7 +39,7 @@ IN_PROC_BROWSER_TEST_F(AppWindowBrowserTest, MAYBE_FrameInsetsForDefaultFrame) { // This test is also disabled on Linux because frame: color is ignored on stable // and beta channels (so it can fail the same as the previous test). // TODO(benwells): Re-enable on Linux after frame: color is on stable. -#if defined(TOOLKIT_GTK) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) #define MAYBE_FrameInsetsForColoredFrame DISABLED_FrameInsetsForColoredFrame #else #define MAYBE_FrameInsetsForColoredFrame FrameInsetsForColoredFrame diff --git a/apps/ui/web_contents_sizer.cc b/apps/ui/web_contents_sizer.cc index e19f2cf..041187f 100644 --- a/apps/ui/web_contents_sizer.cc +++ b/apps/ui/web_contents_sizer.cc @@ -9,8 +9,6 @@ #if defined(USE_AURA) #include "ui/aura/window.h" -#elif defined(TOOLKIT_GTK) -#include <gtk/gtk.h> #elif defined(OS_ANDROID) #include "content/public/browser/render_widget_host_view.h" #endif @@ -22,9 +20,6 @@ void ResizeWebContents(content::WebContents* web_contents, #if defined(USE_AURA) aura::Window* window = web_contents->GetView()->GetNativeView(); window->SetBounds(gfx::Rect(window->bounds().origin(), new_size)); -#elif defined(TOOLKIT_GTK) - GtkWidget* widget = web_contents->GetView()->GetNativeView(); - gtk_widget_set_size_request(widget, new_size.width(), new_size.height()); #elif defined(OS_ANDROID) content::RenderWidgetHostView* view = web_contents->GetRenderWidgetHostView(); if (view) diff --git a/chrome/browser/background/background_contents_service_unittest.cc b/chrome/browser/background/background_contents_service_unittest.cc index 9f7d075..7389d9e 100644 --- a/chrome/browser/background/background_contents_service_unittest.cc +++ b/chrome/browser/background/background_contents_service_unittest.cc @@ -119,7 +119,7 @@ class MockBackgroundContents : public BackgroundContents { Profile* profile_; }; -#if defined(ENABLE_NOTIFICATIONS) && !defined(TOOLKIT_GTK) +#if defined(ENABLE_NOTIFICATIONS) // Wait for the notification created. class NotificationWaiter : public message_center::MessageCenterObserver { public: @@ -343,7 +343,7 @@ TEST_F(BackgroundContentsServiceTest, TestApplicationIDLinkage) { EXPECT_EQ(url2.spec(), GetPrefURLForApp(&profile, contents2->appid())); } -#if defined(ENABLE_NOTIFICATIONS) && !defined(TOOLKIT_GTK) +#if defined(ENABLE_NOTIFICATIONS) TEST_F(BackgroundContentsServiceNotificationTest, TestShowBalloon) { scoped_refptr<extensions::Extension> extension = extension_test_util::LoadManifest("image_loading_tracker", "app.json"); diff --git a/chrome/browser/browser_keyevents_browsertest.cc b/chrome/browser/browser_keyevents_browsertest.cc index 70d3b74..974c634 100644 --- a/chrome/browser/browser_keyevents_browsertest.cc +++ b/chrome/browser/browser_keyevents_browsertest.cc @@ -653,14 +653,8 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, DISABLED_AccessKeys) { // On Ash, alt-1..9 are assigned as window selection global accelerators, so // they can not be used as accesskeys. EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAccess1)); -#if defined(TOOLKIT_GTK) - // On GTK, alt-0..9 are assigned as tab selection accelerators, so they can - // not be used as accesskeys. - EXPECT_NO_FATAL_FAILURE(CheckFocusedElement(tab_index, L"")); -#else EXPECT_NO_FATAL_FAILURE(CheckFocusedElement(tab_index, L"1")); #endif -#endif } // Flaky, http://crbug.com/69475. diff --git a/chrome/browser/chrome_browser_main.h b/chrome/browser/chrome_browser_main.h index be706ab..0d1b51c 100644 --- a/chrome/browser/chrome_browser_main.h +++ b/chrome/browser/chrome_browser_main.h @@ -35,7 +35,7 @@ namespace chrome_browser { extern const char kMissingLocaleDataTitle[]; #endif -#if defined(OS_WIN) || defined(TOOLKIT_GTK) +#if defined(OS_WIN) extern const char kMissingLocaleDataMessage[]; #endif } diff --git a/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc b/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc index d0bc463..89632d9a 100644 --- a/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc +++ b/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc @@ -286,9 +286,6 @@ class TestMessageLoop : public base::MessageLoop { virtual ~TestMessageLoop() {} virtual bool IsType(base::MessageLoop::Type type) const OVERRIDE { switch (type) { -#if defined(TOOLKIT_GTK) - case base::MessageLoop::TYPE_GPU: -#endif case base::MessageLoop::TYPE_UI: return BrowserThread::CurrentlyOn(BrowserThread::UI); case base::MessageLoop::TYPE_IO: diff --git a/chrome/browser/defaults.cc b/chrome/browser/defaults.cc index 48f25fc..6d6b6b6 100644 --- a/chrome/browser/defaults.cc +++ b/chrome/browser/defaults.cc @@ -49,12 +49,6 @@ const bool kSyncAutoStarts = false; const bool kShowOtherBrowsersInAboutMemory = true; #endif -#if defined(TOOLKIT_GTK) -const bool kShowCancelButtonInTaskManager = true; -#else -const bool kShowCancelButtonInTaskManager = false; -#endif - #if defined(OS_LINUX) && !defined(OS_CHROMEOS) const bool kScrollEventChangesTab = true; #else diff --git a/chrome/browser/defaults.h b/chrome/browser/defaults.h index c428f04..41b16d6 100644 --- a/chrome/browser/defaults.h +++ b/chrome/browser/defaults.h @@ -68,9 +68,6 @@ extern const bool kSyncAutoStarts; // Should other browsers be shown in about:memory page? extern const bool kShowOtherBrowsersInAboutMemory; -// Should the close button be shown in the Task Manager dialog? -extern const bool kShowCancelButtonInTaskManager; - // Should scroll events on the tabstrip change tabs? extern const bool kScrollEventChangesTab; diff --git a/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc b/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc index 06d2520..d2e6f11 100644 --- a/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc +++ b/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc @@ -611,15 +611,7 @@ IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, CancelScan) { ASSERT_TRUE(RunMediaGalleriesTest("cancel_scan")) << message_; } -// The scan result dialog is not implemented on GTK because it is going away -// soon. -#if defined (TOOLKIT_GTK) -#define MAYBE_Scan DISABLED_Scan -#else -#define MAYBE_Scan Scan -#endif // defined (USE_AURA) || defined(OS_MACOSX) - -IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, MAYBE_Scan) { +IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, Scan) { base::ScopedTempDir scan_root; ASSERT_TRUE(scan_root.CreateUniqueTempDir()); std::vector<base::FilePath> roots; diff --git a/chrome/browser/prefs/pref_service_browsertest.cc b/chrome/browser/prefs/pref_service_browsertest.cc index 26f8820..72eb475 100644 --- a/chrome/browser/prefs/pref_service_browsertest.cc +++ b/chrome/browser/prefs/pref_service_browsertest.cc @@ -24,11 +24,6 @@ #include "chrome/test/base/ui_test_utils.h" #include "ui/gfx/rect.h" -// On GTK, resizing happens asynchronously and we currently don't have a way to -// get called back (it's probably possible, but we don't have that code). Since -// the GTK code is going away, not spending more time on this. -#if !defined(TOOLKIT_GTK) - typedef InProcessBrowserTest PreservedWindowPlacement; IN_PROC_BROWSER_TEST_F(PreservedWindowPlacement, PRE_Test) { @@ -54,8 +49,6 @@ IN_PROC_BROWSER_TEST_F(PreservedWindowPlacement, MAYBE_Test) { ASSERT_EQ(expected_bounds.ToString(), bounds.ToString()); } -#endif // defined(TOOLKIT_GTK) - class PreferenceServiceTest : public InProcessBrowserTest { public: explicit PreferenceServiceTest(bool new_profile) : new_profile_(new_profile) { diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index d9d4fb1..f537991 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -1587,12 +1587,8 @@ void Browser::EnumerateDirectory(WebContents* web_contents, } bool Browser::EmbedsFullscreenWidget() const { -#if defined(TOOLKIT_GTK) - return false; -#else return !CommandLine::ForCurrentProcess()-> HasSwitch(switches::kDisableFullscreenWithinTab); -#endif } void Browser::ToggleFullscreenModeForTab(WebContents* web_contents, diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index 1eb0635..d613264 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc @@ -287,7 +287,7 @@ bool BrowserCommandController::IsReservedCommandOrKey( if (window()->IsFullscreen() && command_id == IDC_FULLSCREEN) return true; -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(TOOLKIT_GTK) +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) // If this key was registered by the user as a content editing hotkey, then // it is not reserved. ui::TextEditKeyBindingsDelegateAuraLinux* delegate = @@ -484,7 +484,7 @@ void BrowserCommandController::ExecuteCommandWithDisposition( break; #endif -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(TOOLKIT_GTK) +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) case IDC_USE_SYSTEM_TITLE_BAR: { PrefService* prefs = browser_->profile()->GetPrefs(); prefs->SetBoolean(prefs::kUseCustomChromeFrame, @@ -914,7 +914,7 @@ void BrowserCommandController::InitCommandState() { command_updater_.UpdateCommandEnabled(IDC_VISIT_DESKTOP_OF_LRU_USER_2, true); command_updater_.UpdateCommandEnabled(IDC_VISIT_DESKTOP_OF_LRU_USER_3, true); #endif -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(TOOLKIT_GTK) +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) command_updater_.UpdateCommandEnabled(IDC_USE_SYSTEM_TITLE_BAR, true); #endif diff --git a/chrome/browser/ui/find_bar/find_bar_host_unittest_util.h b/chrome/browser/ui/find_bar/find_bar_host_unittest_util.h index e4280f4..91f4ad6 100644 --- a/chrome/browser/ui/find_bar/find_bar_host_unittest_util.h +++ b/chrome/browser/ui/find_bar/find_bar_host_unittest_util.h @@ -9,7 +9,7 @@ namespace chrome { -#if defined(TOOLKIT_VIEWS) || defined(TOOLKIT_GTK) || defined(OS_MACOSX) +#if defined(TOOLKIT_VIEWS) || defined(OS_MACOSX) void DisableFindBarAnimationsDuringTesting(bool disable); #else static inline void DisableFindBarAnimationsDuringTesting(bool disable) {} diff --git a/chrome/browser/ui/pdf/pdf_tab_helper.cc b/chrome/browser/ui/pdf/pdf_tab_helper.cc index a01b3a4..f63ff59 100644 --- a/chrome/browser/ui/pdf/pdf_tab_helper.cc +++ b/chrome/browser/ui/pdf/pdf_tab_helper.cc @@ -16,11 +16,6 @@ #include "chrome/common/render_messages.h" #include "content/public/browser/navigation_details.h" -#if defined(TOOLKIT_GTK) -#include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.h" -#include "content/public/browser/javascript_dialog_manager.h" -#endif - DEFINE_WEB_CONTENTS_USER_DATA_KEY(PDFTabHelper); PDFTabHelper::PDFTabHelper(content::WebContents* web_contents) @@ -107,20 +102,5 @@ void PDFTabHelper::OnModalPromptForPassword(const std::string& prompt, base::Callback<void(bool, const base::string16&)> callback = base::Bind(&PDFTabHelper::OnModalPromptForPasswordClosed, base::Unretained(this), reply_message); -#if !defined(TOOLKIT_GTK) ShowPDFPasswordDialog(web_contents(), base::UTF8ToUTF16(prompt), callback); -#else - // GTK is going away, so it's not worth the effort to create a password dialog - // for it. Cheat (for now) until the GTK code is removed. - bool did_suppress_message; - GetJavaScriptDialogManagerInstance()->RunJavaScriptDialog( - web_contents(), - GURL(), - std::string(), - content::JAVASCRIPT_MESSAGE_TYPE_PROMPT, - base::UTF8ToUTF16(prompt), - base::string16(), - callback, - &did_suppress_message); -#endif // TOOLKIT_GTK } diff --git a/chrome/browser/ui/pdf/pdf_tab_helper.h b/chrome/browser/ui/pdf/pdf_tab_helper.h index 04ae744..5dca4a6 100644 --- a/chrome/browser/ui/pdf/pdf_tab_helper.h +++ b/chrome/browser/ui/pdf/pdf_tab_helper.h @@ -61,7 +61,6 @@ class PDFTabHelper : public content::WebContentsObserver, DISALLOW_COPY_AND_ASSIGN(PDFTabHelper); }; -#if !defined(TOOLKIT_GTK) typedef base::Callback<void(bool /* success */, const base::string16& /* password */)> PasswordDialogClosedCallback; @@ -70,6 +69,5 @@ typedef base::Callback<void(bool /* success */, void ShowPDFPasswordDialog(content::WebContents* web_contents, const base::string16& prompt, const PasswordDialogClosedCallback& callback); -#endif // !TOOLKIT_GTK #endif // CHROME_BROWSER_UI_PDF_PDF_TAB_HELPER_H_ diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc index 2403d65..58995aa 100644 --- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc +++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc @@ -779,16 +779,8 @@ Browser* StartupBrowserCreatorImpl::OpenTabsInBrowser( if (!profile_ && browser) profile_ = browser->profile(); - if (!browser || !browser->is_type_tabbed()) { + if (!browser || !browser->is_type_tabbed()) browser = new Browser(Browser::CreateParams(profile_, desktop_type)); - } else { -#if defined(TOOLKIT_GTK) - // Setting the time of the last action on the window here allows us to steal - // focus, which is what the user wants when opening a new tab in an existing - // browser window. - gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeWindow()); -#endif - } bool first_tab = true; ProtocolHandlerRegistry* registry = profile_ ? diff --git a/chrome/common/localized_error.cc b/chrome/common/localized_error.cc index 1d95c20..3976b6f 100644 --- a/chrome/common/localized_error.cc +++ b/chrome/common/localized_error.cc @@ -454,13 +454,7 @@ const LocalizedErrorMap* LookupErrorMap(const std::string& error_domain, } bool LocaleIsRTL() { -#if defined(TOOLKIT_GTK) - // base::i18n::IsRTL() uses the GTK text direction, which doesn't work within - // the renderer sandbox. - return base::i18n::ICUIsRTL(); -#else return base::i18n::IsRTL(); -#endif } // Returns a dictionary containing the strings for the settings menu under the diff --git a/chrome/test/base/interactive_test_utils.h b/chrome/test/base/interactive_test_utils.h index ddab764..c7ada3c 100644 --- a/chrome/test/base/interactive_test_utils.h +++ b/chrome/test/base/interactive_test_utils.h @@ -124,8 +124,6 @@ bool SendKeyPressAndWaitWithDetails( void MoveMouseToCenterAndPress( #if defined(TOOLKIT_VIEWS) views::View* view, -#elif defined(TOOLKIT_GTK) - GtkWidget* widget, #elif defined(OS_IOS) UIView* view, #elif defined(OS_MACOSX) diff --git a/ppapi/proxy/ppb_image_data_proxy.cc b/ppapi/proxy/ppb_image_data_proxy.cc index c9d61f9..87b49a7 100644 --- a/ppapi/proxy/ppb_image_data_proxy.cc +++ b/ppapi/proxy/ppb_image_data_proxy.cc @@ -416,8 +416,6 @@ SkCanvas* PlatformImageData::GetCanvas() { ImageHandle PlatformImageData::NullHandle() { #if defined(OS_WIN) return NULL; -#elif defined(TOOLKIT_GTK) - return 0; #else return ImageHandle(); #endif @@ -426,8 +424,6 @@ ImageHandle PlatformImageData::NullHandle() { ImageHandle PlatformImageData::HandleFromInt(int32_t i) { #if defined(OS_WIN) return reinterpret_cast<ImageHandle>(i); -#elif defined(TOOLKIT_GTK) - return static_cast<ImageHandle>(i); #else return ImageHandle(i, false); #endif @@ -607,14 +603,6 @@ PP_Resource PPB_ImageData_Proxy::CreateImageData( #if defined(OS_WIN) *image_handle = dispatcher->ShareHandleWithRemote( reinterpret_cast<HANDLE>(static_cast<intptr_t>(local_fd)), false); -#elif defined(TOOLKIT_GTK) - // On X Windows, a PlatformImageData is backed by a SysV shared memory key, - // so embed that in a fake PlatformFileForTransit and don't share it across - // processes. - if (type == PPB_ImageData_Shared::PLATFORM) - *image_handle = IPC::PlatformFileForTransit(local_fd, false); - else - *image_handle = dispatcher->ShareHandleWithRemote(local_fd, false); #elif defined(OS_POSIX) *image_handle = dispatcher->ShareHandleWithRemote(local_fd, false); #else @@ -643,12 +631,7 @@ void PPB_ImageData_Proxy::OnHostMsgCreatePlatform( desc, &image_handle, &byte_count); result->SetHostResource(instance, resource); if (resource) { -#if defined(TOOLKIT_GTK) - // On X Windows ImageHandle is a SysV shared memory key. - *result_image_handle = image_handle.fd; -#else *result_image_handle = image_handle; -#endif } else { *result_image_handle = PlatformImageData::NullHandle(); } diff --git a/ppapi/proxy/serialized_structs.h b/ppapi/proxy/serialized_structs.h index fb93dd1..f3e114c 100644 --- a/ppapi/proxy/serialized_structs.h +++ b/ppapi/proxy/serialized_structs.h @@ -135,9 +135,6 @@ struct PPPDecryptor_Buffer { // TODO(raymes): Make ImageHandle compatible with SerializedHandle. #if defined(OS_WIN) typedef HANDLE ImageHandle; -#elif defined(TOOLKIT_GTK) -// On legacy X Windows this is a SysV shared memory key. -typedef int ImageHandle; #else typedef base::SharedMemoryHandle ImageHandle; #endif diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc index 9d6ffa7..cb70d89 100644 --- a/ui/base/accelerators/accelerator.cc +++ b/ui/base/accelerators/accelerator.cc @@ -6,8 +6,6 @@ #if defined(OS_WIN) #include <windows.h> -#elif defined(TOOLKIT_GTK) -#include <gdk/gdk.h> #endif #include "base/i18n/rtl.h" @@ -192,23 +190,6 @@ base::string16 Accelerator::GetShortcutText() const { if (c != 0) shortcut += static_cast<base::string16::value_type>(base::ToUpperASCII(c)); -#elif defined(TOOLKIT_GTK) - const gchar* name = NULL; - switch (key_code_) { - case ui::VKEY_OEM_2: - name = static_cast<const gchar*>("/"); - break; - default: - name = gdk_keyval_name(gdk_keyval_to_lower(key_code_)); - break; - } - if (name) { - if (name[0] != 0 && name[1] == 0) - shortcut += - static_cast<base::string16::value_type>(g_ascii_toupper(name[0])); - else - shortcut += base::UTF8ToUTF16(name); - } #endif } else { shortcut = l10n_util::GetStringUTF16(string_id); diff --git a/ui/base/clipboard/clipboard.h b/ui/base/clipboard/clipboard.h index 2dfaea9..9474847 100644 --- a/ui/base/clipboard/clipboard.h +++ b/ui/base/clipboard/clipboard.h @@ -20,10 +20,6 @@ #include "ui/base/clipboard/clipboard_types.h" #include "ui/base/ui_base_export.h" -#if defined(TOOLKIT_GTK) -#include <gdk/gdk.h> -#endif - #if defined(OS_WIN) #include <objidl.h> #elif defined(OS_ANDROID) @@ -56,10 +52,6 @@ class Size; class SkBitmap; -#if defined(TOOLKIT_GTK) -typedef struct _GtkClipboard GtkClipboard; -#endif - #ifdef __OBJC__ @class NSString; #else @@ -130,11 +122,6 @@ class UI_BASE_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) { explicit FormatType(NSString* native_format); NSString* ToNSString() const { return data_; } NSString* data_; -#elif defined(TOOLKIT_GTK) - explicit FormatType(const std::string& native_format); - explicit FormatType(const GdkAtom& native_format); - const GdkAtom& ToGdkAtom() const { return data_; } - GdkAtom data_; #elif defined(OS_ANDROID) explicit FormatType(const std::string& native_format); const std::string& data() const { return data_; } @@ -371,30 +358,6 @@ class UI_BASE_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) { // Mark this as mutable so const methods can still do lazy initialization. mutable scoped_ptr<base::win::MessageWindow> clipboard_owner_; -#elif defined(TOOLKIT_GTK) - // The public API is via WriteObjects() which dispatches to multiple - // Write*() calls, but on GTK we must write all the clipboard types - // in a single GTK call. To support this we store the current set - // of data we intend to put on the clipboard on clipboard_data_ as - // WriteObjects is running, and then at the end call SetGtkClipboard - // which replaces whatever is on the system clipboard with the - // contents of clipboard_data_. - - public: - typedef std::map<std::string, std::pair<char*, size_t> > TargetMap; - - private: - // Write changes to gtk clipboard. - void SetGtkClipboard(ClipboardType type); - // Insert a mapping into clipboard_data_. - void InsertMapping(const char* key, char* data, size_t data_len); - - // Find the gtk clipboard for the passed type enum. - GtkClipboard* LookupBackingClipboard(ClipboardType type) const; - - TargetMap* clipboard_data_; - GtkClipboard* clipboard_; - GtkClipboard* primary_selection_; #elif defined(USE_CLIPBOARD_AURAX11) private: // We keep our implementation details private because otherwise we bring in diff --git a/ui/base/clipboard/clipboard_unittest.cc b/ui/base/clipboard/clipboard_unittest.cc index 30798d3..b3387ef 100644 --- a/ui/base/clipboard/clipboard_unittest.cc +++ b/ui/base/clipboard/clipboard_unittest.cc @@ -159,7 +159,7 @@ TEST_F(ClipboardTest, RTFTest) { EXPECT_EQ(rtf, result); } -#if defined(TOOLKIT_GTK) +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) TEST_F(ClipboardTest, MultipleBufferTest) { base::string16 text(ASCIIToUTF16("Standard")), text_result; base::string16 markup(ASCIIToUTF16("<string>Selection</string>")); @@ -254,27 +254,6 @@ TEST_F(ClipboardTest, UniodeHTMLTest) { } #endif // defined(OS_WIN) -#if defined(TOOLKIT_GTK) -// Regression test for crbug.com/56298 (pasting empty HTML crashes Linux). -TEST_F(ClipboardTest, EmptyHTMLTest) { - // ScopedClipboardWriter doesn't let us write empty data to the clipboard. - clipboard().clipboard_data_ = new Clipboard::TargetMap(); - // The 1 is so the compiler doesn't warn about allocating an empty array. - char* empty = new char[1]; - clipboard().InsertMapping("text/html", empty, 0U); - clipboard().SetGtkClipboard(CLIPBOARD_TYPE_COPY_PASTE); - - EXPECT_TRUE(clipboard().IsFormatAvailable(Clipboard::GetHtmlFormatType(), - CLIPBOARD_TYPE_COPY_PASTE)); - base::string16 markup_result; - std::string url_result; - uint32 ignored; - clipboard().ReadHTML(CLIPBOARD_TYPE_COPY_PASTE, &markup_result, &url_result, - &ignored, &ignored); - EXPECT_PRED2(MarkupMatches, base::string16(), markup_result); -} -#endif - // TODO(estade): Port the following test (decide what target we use for urls) #if !defined(OS_POSIX) || defined(OS_MACOSX) TEST_F(ClipboardTest, BookmarkTest) { @@ -414,19 +393,8 @@ static void TestBitmapWrite(Clipboard* clipboard, for (int i = 0; i < image.width(); ++i) { int offset = i + j * image.width(); uint32 pixel = SkPreMultiplyColor(bitmap_data[offset]); -#if defined(TOOLKIT_GTK) - // Non-Aura GTK doesn't support alpha transparency. Instead, the alpha - // channel is always set to 0xFF - see http://crbug.com/154573. - // However, since we premultiplied above, we must also premultiply here - // before unpremultiplying and setting alpha to 0xFF; otherwise, the - // results will not match GTK's. - EXPECT_EQ( - SkUnPreMultiply::PMColorToColor(pixel) | 0xFF000000, row_address[i]) - << "i = " << i << ", j = " << j; -#else EXPECT_EQ(pixel, row_address[i]) << "i = " << i << ", j = " << j; -#endif // defined(TOOLKIT_GTK) } } } diff --git a/ui/base/clipboard/custom_data_helper.h b/ui/base/clipboard/custom_data_helper.h index 47e7f6a..8c927aa 100644 --- a/ui/base/clipboard/custom_data_helper.h +++ b/ui/base/clipboard/custom_data_helper.h @@ -30,7 +30,7 @@ namespace ui { #if defined(OS_MACOSX) && !defined(USE_AURA) UI_BASE_EXPORT extern NSString* const kWebCustomDataPboardType; -#elif (!defined(OS_WIN) && defined(USE_AURA)) || defined(TOOLKIT_GTK) +#elif !defined(OS_WIN) && defined(USE_AURA) UI_BASE_EXPORT extern const char kMimeTypeWebCustomData[]; #endif diff --git a/ui/base/clipboard/custom_data_helper_linux.cc b/ui/base/clipboard/custom_data_helper_linux.cc index c9dc47f..d8cc89e 100644 --- a/ui/base/clipboard/custom_data_helper_linux.cc +++ b/ui/base/clipboard/custom_data_helper_linux.cc @@ -8,8 +8,6 @@ namespace ui { // TODO(dcheng): This name is temporary. See crbug.com/106449 -#if defined(USE_AURA) || defined(TOOLKIT_GTK) const char kMimeTypeWebCustomData[] = "chromium/x-web-custom-data"; -#endif } // namespace ui diff --git a/ui/base/l10n/l10n_util_unittest.cc b/ui/base/l10n/l10n_util_unittest.cc index 2d33a0f..dbf3895 100644 --- a/ui/base/l10n/l10n_util_unittest.cc +++ b/ui/base/l10n/l10n_util_unittest.cc @@ -374,7 +374,6 @@ TEST_F(L10nUtilTest, GetDisplayNameForLocale) { result = l10n_util::GetDisplayNameForLocale("xyz-xyz", "en", false); EXPECT_EQ(ASCIIToUTF16("xyz (XYZ)"), result); -#if !defined(TOOLKIT_GTK) // Check for directional markers when using RTL languages to ensure that // direction neutral characters such as parentheses are properly formatted. @@ -387,7 +386,6 @@ TEST_F(L10nUtilTest, GetDisplayNameForLocale) { // Clean up. base::i18n::SetICUDefaultLocale(original_locale); -#endif // ToUpper and ToLower should work with embedded NULLs. const size_t length_with_null = 4; diff --git a/ui/gfx/gfx.gyp b/ui/gfx/gfx.gyp index 4d09ad4..d671737 100644 --- a/ui/gfx/gfx.gyp +++ b/ui/gfx/gfx.gyp @@ -338,24 +338,6 @@ 'canvas_skia.cc', ], }], - ['toolkit_uses_gtk == 1', { - 'dependencies': [ - '<(DEPTH)/build/linux/system.gyp:gtk', - ], - 'sources': [ - 'gtk_native_view_id_manager.cc', - 'gtk_native_view_id_manager.h', - 'gtk_preserve_window.cc', - 'gtk_preserve_window.h', - 'gdk_compat.h', - 'gtk_compat.h', - 'gtk_util.cc', - 'gtk_util.h', - 'image/cairo_cached_surface.cc', - 'image/cairo_cached_surface.h', - 'scoped_gobject.h', - ], - }], ['OS=="win"', { 'sources': [ 'gdi_util.cc', diff --git a/ui/gfx/image/cairo_cached_surface.cc b/ui/gfx/image/cairo_cached_surface.cc deleted file mode 100644 index 2de4a32..0000000 --- a/ui/gfx/image/cairo_cached_surface.cc +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ui/gfx/image/cairo_cached_surface.h" - -#include <gtk/gtk.h> - -#include "base/basictypes.h" -#include "base/logging.h" - -namespace gfx { - -CairoCachedSurface::CairoCachedSurface() : pixbuf_(NULL) { -} - -CairoCachedSurface::~CairoCachedSurface() { - Reset(); -} - -void CairoCachedSurface::Reset() { - for (SurfaceVector::iterator it = surface_map_.begin(); - it != surface_map_.end(); ++it) { - cairo_surface_destroy(it->second); - } - surface_map_.clear(); - - if (pixbuf_) { - g_object_unref(pixbuf_); - pixbuf_ = NULL; - } -} - -int CairoCachedSurface::Width() const { - return pixbuf_ ? gdk_pixbuf_get_width(pixbuf_) : -1; -} - -int CairoCachedSurface::Height() const { - return pixbuf_ ? gdk_pixbuf_get_height(pixbuf_) : -1; -} - -void CairoCachedSurface::UsePixbuf(GdkPixbuf* pixbuf) { - if (pixbuf) - g_object_ref(pixbuf); - - Reset(); - - pixbuf_ = pixbuf; -} - -void CairoCachedSurface::SetSource(cairo_t* cr, GtkWidget* widget, - int x, int y) const { - SetSource(cr, gtk_widget_get_display(widget), x, y); -} - -void CairoCachedSurface::SetSource(cairo_t* cr, GdkDisplay* display, - int x, int y) const { - DCHECK(pixbuf_); - DCHECK(cr); - DCHECK(display); - - cairo_surface_t* surface = GetSurfaceFor(cr, display); - cairo_set_source_surface(cr, surface, x, y); -} - -void CairoCachedSurface::MaskSource(cairo_t* cr, GtkWidget* widget, - int x, int y) const { - MaskSource(cr, gtk_widget_get_display(widget), x, y); -} - -void CairoCachedSurface::MaskSource(cairo_t* cr, GdkDisplay* display, - int x, int y) const { - DCHECK(pixbuf_); - DCHECK(cr); - DCHECK(display); - - cairo_surface_t* surface = GetSurfaceFor(cr, display); - cairo_mask_surface(cr, surface, x, y); -} - -cairo_surface_t* CairoCachedSurface::GetSurfaceFor(cairo_t* cr, - GdkDisplay* display) const { - for (SurfaceVector::const_iterator it = surface_map_.begin(); - it != surface_map_.end(); ++it) { - if (display == it->first) { - return it->second; - } - } - - // First time here since last UsePixbuf call. Generate the surface. - cairo_surface_t* target = cairo_get_target(cr); - cairo_surface_t* out = cairo_surface_create_similar( - target, - CAIRO_CONTENT_COLOR_ALPHA, - gdk_pixbuf_get_width(pixbuf_), - gdk_pixbuf_get_height(pixbuf_)); - - DCHECK(out); - - cairo_t* copy_cr = cairo_create(out); - gdk_cairo_set_source_pixbuf(copy_cr, pixbuf_, 0, 0); - cairo_paint(copy_cr); - cairo_destroy(copy_cr); - - surface_map_.push_back(std::make_pair(display, out)); - return out; -} - -} // namespace gfx diff --git a/ui/gfx/image/cairo_cached_surface.h b/ui/gfx/image/cairo_cached_surface.h deleted file mode 100644 index ceece4b..0000000 --- a/ui/gfx/image/cairo_cached_surface.h +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef UI_GFX_IMAGE_CAIRO_CACHED_SURFACE_H_ -#define UI_GFX_IMAGE_CAIRO_CACHED_SURFACE_H_ - -#include <vector> - -#include "ui/gfx/gfx_export.h" - -typedef struct _GdkDisplay GdkDisplay; -typedef struct _GdkPixbuf GdkPixbuf; -typedef struct _GtkWidget GtkWidget; -typedef struct _cairo cairo_t; -typedef struct _cairo_surface cairo_surface_t; - -namespace gfx { - -// A helper class that takes a GdkPixbuf* and renders it to the screen. Unlike -// gdk_cairo_set_source_pixbuf(), CairoCachedSurface assumes that the pixbuf is -// immutable after UsePixbuf() is called and can be sent to the display server -// once. From then on, that cached version is used so we don't upload the same -// image each and every time we expose. -// -// Most cached surfaces are owned by the GtkThemeService, which associates -// them with a certain XDisplay. Some users of surfaces (CustomDrawButtonBase, -// for example) own their surfaces instead since they interact with the -// ResourceBundle instead of the GtkThemeService. -class GFX_EXPORT CairoCachedSurface { - public: - CairoCachedSurface(); - ~CairoCachedSurface(); - - // Whether this CairoCachedSurface owns a GdkPixbuf. - bool valid() const { - return pixbuf_; - } - - // Delete all our data. - void Reset(); - - // The dimensions of the underlying pixbuf/surface. (or -1 if invalid.) - int Width() const; - int Height() const; - - // Sets the pixbuf that we pass to cairo. Calling UsePixbuf() only derefs the - // current pixbuf and surface (if they exist). Actually transfering data to - // the X server occurs at SetSource() time. Calling UsePixbuf() should only - // be done once as it clears cached data from the X server. - void UsePixbuf(GdkPixbuf* pixbuf); - - // Sets our pixbuf as the active surface starting at (x, y), uploading it in - // case we don't have an X backed surface cached. - void SetSource(cairo_t* cr, GtkWidget* widget, int x, int y) const; - void SetSource(cairo_t* cr, GdkDisplay* display, int x, int y) const; - - // Performs a mask operation, using this surface as the alpha channel. - void MaskSource(cairo_t* cr, GtkWidget* widget, int x, int y) const; - void MaskSource(cairo_t* cr, GdkDisplay* display, int x, int y) const; - - // Raw access to the pixbuf. May be NULL. Used for a few gdk operations - // regarding window shaping. - GdkPixbuf* pixbuf() { return pixbuf_; } - - private: - typedef std::vector<std::pair<GdkDisplay*, cairo_surface_t*> > SurfaceVector; - - // Returns a surface . Caches results so only one copy of the image data - // lives on the display server. - cairo_surface_t* GetSurfaceFor(cairo_t* cr, GdkDisplay* display) const; - - // The source pixbuf. - GdkPixbuf* pixbuf_; - - // Our list of cached surfaces. 99% of the time, this will only contain a - // single entry. At most two. We need to get this right for multiple displays - // to work correct, since each GdkDisplay is a different display server. - mutable SurfaceVector surface_map_; -}; - -} // namespace gfx - -#endif // UI_GFX_IMAGE_CAIRO_CACHED_SURFACE_H_ diff --git a/ui/gfx/image/image.h b/ui/gfx/image/image.h index 68e7a23..6f0e926 100644 --- a/ui/gfx/image/image.h +++ b/ui/gfx/image/image.h @@ -44,10 +44,6 @@ struct ImagePNGRep; class ImageSkia; class Size; -#if defined(TOOLKIT_GTK) -class CairoCachedSurface; -#endif - namespace internal { class ImageRep; class ImageStorage; @@ -77,10 +73,7 @@ class GFX_EXPORT Image { // representation. explicit Image(const ImageSkia& image); -#if defined(TOOLKIT_GTK) - // Does not increase |pixbuf|'s reference count; expects to take ownership. - explicit Image(GdkPixbuf* pixbuf); -#elif defined(OS_IOS) +#if defined(OS_IOS) // Does not retain |image|; expects to take ownership. explicit Image(UIImage* image); #elif defined(OS_MACOSX) @@ -122,10 +115,7 @@ class GFX_EXPORT Image { // the Image. Must only be called if IsEmpty() is false. const SkBitmap* ToSkBitmap() const; const ImageSkia* ToImageSkia() const; -#if defined(TOOLKIT_GTK) - GdkPixbuf* ToGdkPixbuf() const; - CairoCachedSurface* const ToCairo() const; -#elif defined(OS_IOS) +#if defined(OS_IOS) UIImage* ToUIImage() const; #elif defined(OS_MACOSX) NSImage* ToNSImage() const; @@ -158,9 +148,7 @@ class GFX_EXPORT Image { scoped_refptr<base::RefCountedMemory> Copy1xPNGBytes() const; ImageSkia* CopyImageSkia() const; SkBitmap* CopySkBitmap() const; -#if defined(TOOLKIT_GTK) - GdkPixbuf* CopyGdkPixbuf() const; -#elif defined(OS_IOS) +#if defined(OS_IOS) UIImage* CopyUIImage() const; #elif defined(OS_MACOSX) NSImage* CopyNSImage() const; diff --git a/ui/gfx/platform_font_pango.cc b/ui/gfx/platform_font_pango.cc index 956be2d..efc940b 100644 --- a/ui/gfx/platform_font_pango.cc +++ b/ui/gfx/platform_font_pango.cc @@ -24,11 +24,6 @@ #include "ui/gfx/pango_util.h" #include "ui/gfx/text_utils.h" -#if defined(TOOLKIT_GTK) -#include <gdk/gdk.h> -#include <gtk/gtk.h> -#endif - namespace { // The font family name which is used when a user's application font for @@ -256,7 +251,6 @@ PlatformFontPango::~PlatformFontPango() {} // static std::string PlatformFontPango::GetDefaultFont() { -#if !defined(TOOLKIT_GTK) #if defined(OS_CHROMEOS) // Font name must have been provided by way of SetDefaultFontDescription(). CHECK(default_font_description_); @@ -268,23 +262,8 @@ std::string PlatformFontPango::GetDefaultFont() { return "sans 10"; #endif // defined(OS_CHROMEOS) -#else - GtkSettings* settings = gtk_settings_get_default(); - - gchar* font_name = NULL; - g_object_get(settings, "gtk-font-name", &font_name, NULL); - - // Temporary CHECK for helping track down - // http://code.google.com/p/chromium/issues/detail?id=12530 - CHECK(font_name) << " Unable to get gtk-font-name for default font."; - - std::string default_font = std::string(font_name); - g_free(font_name); - return default_font; -#endif // !defined(TOOLKIT_GTK) } - void PlatformFontPango::InitWithNameAndSize(const std::string& font_name, int font_size) { DCHECK_GT(font_size, 0); diff --git a/ui/gl/gl_surface_glx.cc b/ui/gl/gl_surface_glx.cc index 7647694..f35fcda 100644 --- a/ui/gl/gl_surface_glx.cc +++ b/ui/gl/gl_surface_glx.cc @@ -299,71 +299,6 @@ SGIVideoSyncThread* SGIVideoSyncThread::g_video_sync_thread = NULL; // goes up (rather than on-demand when we start the thread). Display* SGIVideoSyncProviderThreadShim::display_ = NULL; -#if defined(TOOLKIT_GTK) -// A mechanism for forwarding XExpose events from one window to another. -// Because in the workaround for http://crbug.com/145600 the child window -// is placed on top of the parent window, only the child window will receive -// all expose events. These need to be forwared to the parent window to inform -// it that it should paint. -class XExposeEventForwarder : public base::MessagePumpObserver { - public: - XExposeEventForwarder() {} - virtual ~XExposeEventForwarder() { - DCHECK(child_to_parent_map_.empty()); - } - void AddParentChildPair(gfx::AcceleratedWidget parent_window, - gfx::AcceleratedWidget child_window) { - if (child_to_parent_map_.empty()) - base::MessagePumpX11::Current()->AddObserver(this); - - DCHECK(child_to_parent_map_.find(child_window) == - child_to_parent_map_.end()); - child_to_parent_map_.insert(std::make_pair( - child_window, parent_window)); - } - void RemoveParentChildPair(gfx::AcceleratedWidget parent_window, - gfx::AcceleratedWidget child_window) { - DCHECK(child_to_parent_map_.find(child_window) != - child_to_parent_map_.end()); - child_to_parent_map_.erase(child_window); - - if (child_to_parent_map_.empty()) - base::MessagePumpX11::Current()->RemoveObserver(this); - } - - private: - virtual void WillProcessEvent(const base::NativeEvent& xevent) OVERRIDE { - if (xevent->type != Expose) - return; - - WindowMap::const_iterator found = child_to_parent_map_.find( - xevent->xexpose.window); - if (found == child_to_parent_map_.end()) - return; - - gfx::AcceleratedWidget target_window = found->second; - XEvent forwarded_event = *xevent; - forwarded_event.xexpose.window = target_window; - XSendEvent(g_display, target_window, False, ExposureMask, - &forwarded_event); - } - virtual void DidProcessEvent(const base::NativeEvent& xevent) OVERRIDE { - } - - typedef std::map<gfx::AcceleratedWidget, gfx::AcceleratedWidget> WindowMap; - WindowMap child_to_parent_map_; - - DISALLOW_COPY_AND_ASSIGN(XExposeEventForwarder); -}; - -static base::LazyInstance<XExposeEventForwarder> g_xexpose_event_forwarder = - LAZY_INSTANCE_INITIALIZER; - -// Do not use this workaround when running in test harnesses that do not have -// a message loop or do not have a TYPE_GPU message loop. -bool g_create_child_windows = false; -#endif - } // namespace GLSurfaceGLX::GLSurfaceGLX() {} @@ -380,20 +315,7 @@ bool GLSurfaceGLX::InitializeOneOff() { // it's own thread. XInitThreads(); -#if defined(TOOLKIT_GTK) - // Be sure to use the X display handle and not the GTK display handle if this - // is the GPU process. - g_create_child_windows = - base::MessageLoop::current() && - base::MessageLoop::current()->type() == base::MessageLoop::TYPE_GPU; - - if (g_create_child_windows) - g_display = base::MessagePumpX11::GetDefaultXDisplay(); - else - g_display = base::MessagePumpForUI::GetDefaultXDisplay(); -#else g_display = base::MessagePumpForUI::GetDefaultXDisplay(); -#endif if (!g_display) { LOG(ERROR) << "XOpenDisplay failed."; @@ -467,78 +389,12 @@ void* GLSurfaceGLX::GetDisplay() { GLSurfaceGLX::~GLSurfaceGLX() {} -#if defined(TOOLKIT_GTK) -bool NativeViewGLSurfaceGLX::SetBackbufferAllocation(bool allocated) { - backbuffer_allocated_ = allocated; - AdjustBufferAllocation(); - return true; -} - -void NativeViewGLSurfaceGLX::SetFrontbufferAllocation(bool allocated) { - frontbuffer_allocated_ = allocated; - AdjustBufferAllocation(); -} - -void NativeViewGLSurfaceGLX::AdjustBufferAllocation() { - if (!g_create_child_windows) - return; - - if (frontbuffer_allocated_ || backbuffer_allocated_) - CreateChildWindow(); - else - DestroyChildWindow(); -} - -void NativeViewGLSurfaceGLX::CreateChildWindow() { - DCHECK(g_create_child_windows); - - if (child_window_) - return; - - XSetWindowAttributes set_window_attributes; - set_window_attributes.event_mask = ExposureMask; - child_window_ = XCreateWindow( - g_display, parent_window_, 0, 0, size_.width(), size_.height(), 0, - CopyFromParent, InputOutput, CopyFromParent, CWEventMask, - &set_window_attributes); - g_xexpose_event_forwarder.Pointer()->AddParentChildPair( - parent_window_, child_window_); - - XMapWindow(g_display, child_window_); - XFlush(g_display); -} - -void NativeViewGLSurfaceGLX::DestroyChildWindow() { - if (!child_window_) - return; - - g_xexpose_event_forwarder.Pointer()->RemoveParentChildPair( - parent_window_, child_window_); - XDestroyWindow(g_display, child_window_); - XFlush(g_display); - child_window_ = 0; -} -#endif - NativeViewGLSurfaceGLX::NativeViewGLSurfaceGLX(gfx::AcceleratedWidget window) : parent_window_(window), -#if defined(TOOLKIT_GTK) - child_window_(0), - dummy_window_(0), - backbuffer_allocated_(true), - frontbuffer_allocated_(true), -#endif config_(NULL) { } gfx::AcceleratedWidget NativeViewGLSurfaceGLX::GetDrawableHandle() const { -#if defined(TOOLKIT_GTK) - if (g_create_child_windows) { - if (child_window_) - return child_window_; - return dummy_window_; - } -#endif return parent_window_; } @@ -553,17 +409,6 @@ bool NativeViewGLSurfaceGLX::Initialize() { gfx::AcceleratedWidget window_for_vsync = parent_window_; -#if defined(TOOLKIT_GTK) - if (g_create_child_windows) { - dummy_window_ = XCreateWindow( - g_display, - RootWindow(g_display, XScreenNumberOfScreen(attributes.screen)), - 0, 0, 1, 1, 0, CopyFromParent, InputOutput, attributes.visual, 0, NULL); - window_for_vsync = dummy_window_; - CreateChildWindow(); - } -#endif - if (g_glx_oml_sync_control_supported) vsync_provider_.reset(new OMLSyncControlVSyncProvider(window_for_vsync)); else if (g_glx_sgi_video_sync_supported) @@ -573,21 +418,9 @@ bool NativeViewGLSurfaceGLX::Initialize() { } void NativeViewGLSurfaceGLX::Destroy() { -#if defined(TOOLKIT_GTK) - DestroyChildWindow(); - if (dummy_window_) - XDestroyWindow(g_display, dummy_window_); - dummy_window_ = 0; -#endif } bool NativeViewGLSurfaceGLX::Resize(const gfx::Size& size) { -#if defined(TOOLKIT_GTK) - if (child_window_) { - XResizeWindow(g_display, child_window_, size.width(), size.height()); - XFlush(g_display); - } -#endif size_ = size; return true; } @@ -691,12 +524,6 @@ VSyncProvider* NativeViewGLSurfaceGLX::GetVSyncProvider() { NativeViewGLSurfaceGLX::NativeViewGLSurfaceGLX() : parent_window_(0), -#if defined(TOOLKIT_GTK) - child_window_(0), - dummy_window_(0), - backbuffer_allocated_(true), - frontbuffer_allocated_(true), -#endif config_(NULL) { } diff --git a/ui/gl/gl_surface_glx.h b/ui/gl/gl_surface_glx.h index f9bff2b..8b199f7 100644 --- a/ui/gl/gl_surface_glx.h +++ b/ui/gl/gl_surface_glx.h @@ -76,34 +76,6 @@ class GL_EXPORT NativeViewGLSurfaceGLX : public GLSurfaceGLX { // Window passed in at creation. Always valid. gfx::AcceleratedWidget parent_window_; -#if defined(TOOLKIT_GTK) - // Some NVIDIA drivers don't allow deleting GLX windows separately from their - // parent X windows. Work around this by creating a child X window to the - // window passed in to the constructor, creating the GLX window against the - // child window, and then destroying the child window to destroy the GLX - // window. - // http://crbug.com/145600 - void CreateChildWindow(); - void DestroyChildWindow(); - - // Destroy the child window when both the front and back buffers are - // deallocated. - virtual bool SetBackbufferAllocation(bool allocated) OVERRIDE; - virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE; - void AdjustBufferAllocation(); - - // Child window which is used with GLX, and is discarded when it is - // backgrounded. - gfx::AcceleratedWidget child_window_; - - // Dummy 1x1 window which is supplied to glXMakeCurrent when making - // the context current while its output surface is destroyed. - gfx::AcceleratedWidget dummy_window_; - - bool backbuffer_allocated_; - bool frontbuffer_allocated_; -#endif - void* config_; gfx::Size size_; diff --git a/ui/shell_dialogs/select_file_dialog.cc b/ui/shell_dialogs/select_file_dialog.cc index 7897bca..2496ced 100644 --- a/ui/shell_dialogs/select_file_dialog.cc +++ b/ui/shell_dialogs/select_file_dialog.cc @@ -18,8 +18,6 @@ #include "ui/shell_dialogs/select_file_dialog_win.h" #elif defined(OS_MACOSX) #include "ui/shell_dialogs/select_file_dialog_mac.h" -#elif defined(TOOLKIT_GTK) -#include "ui/shell_dialogs/gtk/select_file_dialog_impl.h" #elif defined(OS_ANDROID) #include "ui/shell_dialogs/select_file_dialog_android.h" #elif defined(USE_AURA) && !defined(USE_ASH) && defined(OS_LINUX) @@ -90,8 +88,6 @@ scoped_refptr<SelectFileDialog> SelectFileDialog::Create( return CreateWinSelectFileDialog(listener, policy); #elif defined(OS_MACOSX) && !defined(USE_AURA) return CreateMacSelectFileDialog(listener, policy); -#elif defined(TOOLKIT_GTK) - return CreateLinuxSelectFileDialog(listener, policy); #elif defined(OS_ANDROID) return CreateAndroidSelectFileDialog(listener, policy); #else diff --git a/ui/surface/transport_dib.h b/ui/surface/transport_dib.h index 4a00967..fa2d1328 100644 --- a/ui/surface/transport_dib.h +++ b/ui/surface/transport_dib.h @@ -6,17 +6,11 @@ #define UI_SURFACE_TRANSPORT_DIB_H_ #include "base/basictypes.h" -#include "ui/surface/surface_export.h" - -#if !defined(TOOLKIT_GTK) #include "base/memory/shared_memory.h" -#endif +#include "ui/surface/surface_export.h" #if defined(OS_WIN) #include <windows.h> -#elif defined(TOOLKIT_GTK) -#include "ui/base/x/x11_util.h" -#include "ui/gfx/x/x11_types.h" #endif class SkCanvas; @@ -74,27 +68,6 @@ class SURFACE_EXPORT TransportDIB { // Returns a default, invalid handle, that is meant to indicate a missing // Transport DIB. static Handle DefaultHandleValue() { return NULL; } -#elif defined(TOOLKIT_GTK) - typedef int Handle; // These two ints are SysV IPC shared memory keys - struct Id { - // Ensure that default initialized Ids are invalid. - Id() : shmkey(-1) { - } - - bool operator<(const Id& other) const { - return shmkey < other.shmkey; - } - - bool operator==(const Id& other) const { - return shmkey == other.shmkey; - } - - int shmkey; - }; - - // Returns a default, invalid handle, that is meant to indicate a missing - // Transport DIB. - static Handle DefaultHandleValue() { return -1; } #else // OS_POSIX typedef base::SharedMemoryHandle Handle; // On POSIX, the inode number of the backing file is used as an id. @@ -166,39 +139,15 @@ class SURFACE_EXPORT TransportDIB { // wire to give this transport DIB to another process. Handle handle() const; -#if defined(TOOLKIT_GTK) - // Map the shared memory into the X server and return an id for the shared - // segment. - XID MapToX(XDisplay* connection); - - void IncreaseInFlightCounter() { inflight_counter_++; } - // Decreases the inflight counter, and deletes the transport DIB if it is - // detached. - void DecreaseInFlightCounter(); - - // Deletes this transport DIB and detaches the shared memory once the - // |inflight_counter_| is zero. - void Detach(); -#endif - private: TransportDIB(); // Verifies that the dib can hold a canvas of the requested dimensions. bool VerifyCanvasSize(int w, int h); -#if defined(TOOLKIT_GTK) - Id key_; // SysV shared memory id - void* address_; // mapped address - XSharedMemoryId x_shm_; // X id for the shared segment - XDisplay* display_; // connection to the X server - size_t inflight_counter_; // How many requests to the X server are in flight - bool detached_; // If true, delete the transport DIB when it is idle -#else explicit TransportDIB(base::SharedMemoryHandle dib); base::SharedMemory shared_memory_; uint32 sequence_num_; -#endif size_t size_; // length, in bytes DISALLOW_COPY_AND_ASSIGN(TransportDIB); diff --git a/ui/surface/transport_dib_posix.cc b/ui/surface/transport_dib_posix.cc index 28095f2..284ed33 100644 --- a/ui/surface/transport_dib_posix.cc +++ b/ui/surface/transport_dib_posix.cc @@ -4,9 +4,6 @@ #include "ui/surface/transport_dib.h" -// Desktop GTK Linux builds use the old-style SYSV SHM based DIBs. -#if !defined(TOOLKIT_GTK) - #include <sys/stat.h> #include <unistd.h> @@ -111,6 +108,3 @@ TransportDIB::Id TransportDIB::id() const { TransportDIB::Handle TransportDIB::handle() const { return shared_memory_.handle(); } - -#endif // !defined(TOOLKIT_GTK) - |