Index: chrome/browser/ui/gtk/gtk_util.cc |
diff --git a/chrome/browser/ui/gtk/gtk_util.cc b/chrome/browser/ui/gtk/gtk_util.cc |
index 8839f0a56c222e7c920dd6bc8dc080ad96184a93..91c7e089df891a3663ab8d1f83c1f79e118b6c1e 100644 |
--- a/chrome/browser/ui/gtk/gtk_util.cc |
+++ b/chrome/browser/ui/gtk/gtk_util.cc |
@@ -25,12 +25,9 @@ |
#include "chrome/browser/profiles/profile_manager.h" |
#include "chrome/browser/ui/browser.h" |
#include "chrome/browser/ui/browser_list.h" |
-#include "chrome/browser/ui/browser_tabstrip.h" |
#include "chrome/browser/ui/browser_window.h" |
#include "chrome/browser/ui/gtk/browser_window_gtk.h" |
#include "chrome/browser/ui/gtk/gtk_theme_service.h" |
-#include "content/public/browser/render_view_host.h" |
-#include "content/public/browser/web_contents.h" |
#include "googleurl/src/gurl.h" |
#include "grit/theme_resources.h" |
#include "ui/base/gtk/gtk_compat.h" |
@@ -48,9 +45,6 @@ |
// These conflict with base/tracked_objects.h, so need to come last. |
#include <gdk/gdkx.h> // NOLINT |
-using content::RenderWidgetHost; |
-using content::WebContents; |
- |
namespace { |
#if defined(GOOGLE_CHROME_BUILD) |
@@ -278,16 +272,6 @@ gboolean PaintNoBackground(GtkWidget* widget, |
return TRUE; |
} |
-WebContents* GetBrowserWindowSelectedWebContents(BrowserWindow* window) { |
- BrowserWindowGtk* browser_window = static_cast<BrowserWindowGtk*>( |
- window); |
- return chrome::GetActiveWebContents(browser_window->browser()); |
-} |
- |
-GtkWidget* GetBrowserWindowFocusedWidget(BrowserWindow* window) { |
- return gtk_window_get_focus(window->GetNativeWindow()); |
-} |
- |
} // namespace |
namespace gtk_util { |
@@ -1008,38 +992,4 @@ void ApplyMessageDialogQuirks(GtkWidget* dialog) { |
} |
} |
-// Performs Cut/Copy/Paste operation on the |window|. |
-// If the current render view is focused, then just call the specified |method| |
-// against the current render view host, otherwise emit the specified |signal| |
-// against the focused widget. |
-// TODO(suzhe): This approach does not work for plugins. |
-void DoCutCopyPaste(BrowserWindow* window, |
- void (RenderWidgetHost::*method)(), |
- const char* signal) { |
- GtkWidget* widget = GetBrowserWindowFocusedWidget(window); |
- if (widget == NULL) |
- return; // Do nothing if no focused widget. |
- |
- WebContents* current_tab = GetBrowserWindowSelectedWebContents(window); |
- if (current_tab && widget == current_tab->GetContentNativeView()) { |
- (current_tab->GetRenderViewHost()->*method)(); |
- } else { |
- guint id; |
- if ((id = g_signal_lookup(signal, G_OBJECT_TYPE(widget))) != 0) |
- g_signal_emit(widget, id, 0); |
- } |
-} |
- |
-void DoCut(BrowserWindow* window) { |
- DoCutCopyPaste(window, &RenderWidgetHost::Cut, "cut-clipboard"); |
-} |
- |
-void DoCopy(BrowserWindow* window) { |
- DoCutCopyPaste(window, &RenderWidgetHost::Copy, "copy-clipboard"); |
-} |
- |
-void DoPaste(BrowserWindow* window) { |
- DoCutCopyPaste(window, &RenderWidgetHost::Paste, "paste-clipboard"); |
-} |
- |
} // namespace gtk_util |