summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-28 15:11:05 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-28 15:11:05 +0000
commitae3fec8dc8d5c0559e495994c7e096354578bcab (patch)
treeb304b634b657ec17fa7331856493a8dda8d5d7b7
parent66db7bc0efc03109bddc3b31f7944d7fe492f643 (diff)
downloadchromium_src-ae3fec8dc8d5c0559e495994c7e096354578bcab.zip
chromium_src-ae3fec8dc8d5c0559e495994c7e096354578bcab.tar.gz
chromium_src-ae3fec8dc8d5c0559e495994c7e096354578bcab.tar.bz2
Move RenderWidgetHostViewMac to content.
BUG=95573 TEST=no visible change Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=103113 Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=103117 Review URL: http://codereview.chromium.org/8052026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103118 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/extension_host_mac.mm2
-rw-r--r--chrome/browser/tab_contents/popup_menu_helper_mac.mm2
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_mac.mm2
-rw-r--r--chrome/browser/ui/cocoa/chrome_event_processing_window.mm4
-rw-r--r--chrome/browser/ui/cocoa/extensions/extension_view_mac.mm4
-rw-r--r--chrome/browser/ui/cocoa/framed_browser_window.mm2
-rw-r--r--chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.mm4
-rw-r--r--chrome/browser/ui/cocoa/tabpose_window.mm2
-rw-r--r--chrome/chrome_browser.gypi8
-rw-r--r--chrome/chrome_tests.gypi3
-rw-r--r--content/DEPS2
-rw-r--r--content/browser/renderer_host/accelerated_plugin_view_mac.h (renamed from chrome/browser/renderer_host/accelerated_plugin_view_mac.h)6
-rw-r--r--content/browser/renderer_host/accelerated_plugin_view_mac.mm (renamed from chrome/browser/renderer_host/accelerated_plugin_view_mac.mm)5
-rw-r--r--content/browser/renderer_host/accelerated_plugin_view_mac_unittest.mm (renamed from chrome/browser/renderer_host/accelerated_plugin_view_mac_unittest.mm)2
-rw-r--r--content/browser/renderer_host/render_widget_host_view_mac.h (renamed from chrome/browser/renderer_host/render_widget_host_view_mac.h)10
-rw-r--r--content/browser/renderer_host/render_widget_host_view_mac.mm (renamed from chrome/browser/renderer_host/render_widget_host_view_mac.mm)11
-rw-r--r--content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper.h (renamed from chrome/browser/ui/cocoa/rwhvm_editcommand_helper.h)25
-rw-r--r--content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper.mm (renamed from chrome/browser/ui/cocoa/rwhvm_editcommand_helper.mm)27
-rw-r--r--content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm (renamed from chrome/browser/ui/cocoa/rwhvm_editcommand_helper_unittest.mm)44
-rw-r--r--content/browser/renderer_host/render_widget_host_view_mac_unittest.mm (renamed from chrome/browser/renderer_host/render_widget_host_view_mac_unittest.mm)12
-rw-r--r--content/content_browser.gypi14
-rw-r--r--content/content_tests.gypi4
22 files changed, 105 insertions, 90 deletions
diff --git a/chrome/browser/extensions/extension_host_mac.mm b/chrome/browser/extensions/extension_host_mac.mm
index 23ec35d..9c9234b 100644
--- a/chrome/browser/extensions/extension_host_mac.mm
+++ b/chrome/browser/extensions/extension_host_mac.mm
@@ -4,10 +4,10 @@
#include "chrome/browser/extensions/extension_host_mac.h"
-#include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
#import "chrome/browser/ui/cocoa/chrome_event_processing_window.h"
#import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h"
#import "chrome/browser/ui/cocoa/info_bubble_window.h"
+#include "content/browser/renderer_host/render_widget_host_view_mac.h"
#include "content/common/native_web_keyboard_event.h"
ExtensionHostMac::~ExtensionHostMac() {
diff --git a/chrome/browser/tab_contents/popup_menu_helper_mac.mm b/chrome/browser/tab_contents/popup_menu_helper_mac.mm
index 94672b8..3125387 100644
--- a/chrome/browser/tab_contents/popup_menu_helper_mac.mm
+++ b/chrome/browser/tab_contents/popup_menu_helper_mac.mm
@@ -8,8 +8,8 @@
#include "base/memory/scoped_nsobject.h"
#include "base/message_loop.h"
-#include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
#include "content/browser/renderer_host/render_view_host.h"
+#include "content/browser/renderer_host/render_widget_host_view_mac.h"
#import "content/common/chrome_application_mac.h"
#include "content/common/notification_source.h"
#import "ui/base/cocoa/base_view.h"
diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm
index c444fa1..54161a9 100644
--- a/chrome/browser/tab_contents/tab_contents_view_mac.mm
+++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm
@@ -9,7 +9,6 @@
#include <string>
#import "chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.h"
-#include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
#include "chrome/browser/tab_contents/popup_menu_helper_mac.h"
#include "chrome/browser/tab_contents/render_view_context_menu_mac.h"
#import "chrome/browser/ui/cocoa/focus_tracker.h"
@@ -20,6 +19,7 @@
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_view_host_factory.h"
#include "content/browser/renderer_host/render_widget_host.h"
+#include "content/browser/renderer_host/render_widget_host_view_mac.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/tab_contents/tab_contents_delegate.h"
#import "content/common/chrome_application_mac.h"
diff --git a/chrome/browser/ui/cocoa/chrome_event_processing_window.mm b/chrome/browser/ui/cocoa/chrome_event_processing_window.mm
index 2275e2a..0e3719a 100644
--- a/chrome/browser/ui/cocoa/chrome_event_processing_window.mm
+++ b/chrome/browser/ui/cocoa/chrome_event_processing_window.mm
@@ -1,15 +1,15 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// 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.
#import "chrome/browser/ui/cocoa/chrome_event_processing_window.h"
#include "base/logging.h"
-#import "chrome/browser/renderer_host/render_widget_host_view_mac.h"
#import "chrome/browser/ui/cocoa/browser_command_executor.h"
#import "chrome/browser/ui/cocoa/browser_frame_view.h"
#import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
#include "chrome/browser/global_keyboard_shortcuts_mac.h"
+#import "content/browser/renderer_host/render_widget_host_view_mac.h"
typedef int (*KeyToCommandMapper)(bool, bool, bool, bool, int, unichar);
diff --git a/chrome/browser/ui/cocoa/extensions/extension_view_mac.mm b/chrome/browser/ui/cocoa/extensions/extension_view_mac.mm
index 878adbe..9b7c20c 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_view_mac.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_view_mac.mm
@@ -1,12 +1,12 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// 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 "chrome/browser/ui/cocoa/extensions/extension_view_mac.h"
#include "chrome/browser/extensions/extension_host.h"
-#include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
#include "content/browser/renderer_host/render_view_host.h"
+#include "content/browser/renderer_host/render_widget_host_view_mac.h"
// The minimum/maximum dimensions of the popup.
const CGFloat ExtensionViewMac::kMinWidth = 25.0;
diff --git a/chrome/browser/ui/cocoa/framed_browser_window.mm b/chrome/browser/ui/cocoa/framed_browser_window.mm
index 296404e..997dfd8 100644
--- a/chrome/browser/ui/cocoa/framed_browser_window.mm
+++ b/chrome/browser/ui/cocoa/framed_browser_window.mm
@@ -10,8 +10,8 @@
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
#import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
#import "chrome/browser/ui/cocoa/themed_window.h"
-#import "chrome/browser/renderer_host/render_widget_host_view_mac.h"
#include "chrome/browser/themes/theme_service.h"
+#import "content/browser/renderer_host/render_widget_host_view_mac.h"
// Replicate specific 10.7 SDK declarations for building with prior SDKs.
#if !defined(MAC_OS_X_VERSION_10_7) || \
diff --git a/chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.mm b/chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.mm
index 3c9be8c..4fad1c0 100644
--- a/chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.mm
+++ b/chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.mm
@@ -1,11 +1,11 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// 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 "chrome/browser/ui/cocoa/notifications/balloon_view_host_mac.h"
-#include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
#include "content/browser/renderer_host/render_view_host.h"
+#include "content/browser/renderer_host/render_widget_host_view_mac.h"
BalloonViewHost::BalloonViewHost(Balloon* balloon)
: BalloonHost(balloon) {
diff --git a/chrome/browser/ui/cocoa/tabpose_window.mm b/chrome/browser/ui/cocoa/tabpose_window.mm
index 928c6e9..6a07d23 100644
--- a/chrome/browser/ui/cocoa/tabpose_window.mm
+++ b/chrome/browser/ui/cocoa/tabpose_window.mm
@@ -18,7 +18,6 @@
#include "chrome/browser/extensions/extension_tab_helper.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
#include "chrome/browser/tab_contents/thumbnail_generator.h"
#include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h"
#include "chrome/browser/ui/cocoa/animation_utils.h"
@@ -32,6 +31,7 @@
#include "chrome/common/pref_names.h"
#include "content/browser/renderer_host/backing_store_mac.h"
#include "content/browser/renderer_host/render_view_host.h"
+#include "content/browser/renderer_host/render_widget_host_view_mac.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "grit/theme_resources.h"
#include "grit/ui_resources.h"
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 349b3a5..f53e678 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1903,8 +1903,6 @@
'browser/remove_rows_table_model.h',
'browser/remoting/firewall_traversal_observer.cc',
'browser/remoting/firewall_traversal_observer.h',
- 'browser/renderer_host/accelerated_plugin_view_mac.h',
- 'browser/renderer_host/accelerated_plugin_view_mac.mm',
'browser/renderer_host/accelerated_surface_container_touch.cc',
'browser/renderer_host/accelerated_surface_container_touch.h',
'browser/renderer_host/chrome_render_message_filter.cc',
@@ -1921,8 +1919,6 @@
'browser/renderer_host/java_bridge_channel_host.h',
'browser/renderer_host/offline_resource_handler.cc',
'browser/renderer_host/offline_resource_handler.h',
- 'browser/renderer_host/render_widget_host_view_mac.h',
- 'browser/renderer_host/render_widget_host_view_mac.mm',
'browser/renderer_host/render_widget_host_view_views.cc',
'browser/renderer_host/render_widget_host_view_views.h',
'browser/renderer_host/render_widget_host_view_views_touch.cc',
@@ -2665,8 +2661,6 @@
'browser/ui/cocoa/repost_form_warning_mac.mm',
'browser/ui/cocoa/restart_browser.h',
'browser/ui/cocoa/restart_browser.mm',
- 'browser/ui/cocoa/rwhvm_editcommand_helper.h',
- 'browser/ui/cocoa/rwhvm_editcommand_helper.mm',
'browser/ui/cocoa/search_engine_dialog_controller.h',
'browser/ui/cocoa/search_engine_dialog_controller.mm',
'browser/ui/cocoa/shell_dialogs_mac.mm',
@@ -4261,8 +4255,6 @@
'../third_party/molokocacao/NSBezierPath+MCAdditions.h',
'../third_party/molokocacao/NSBezierPath+MCAdditions.m',
# Build necessary Mozilla sources
- '../third_party/mozilla/ComplexTextInputPanel.h',
- '../third_party/mozilla/ComplexTextInputPanel.mm',
'../third_party/mozilla/NSPasteboard+Utils.h',
'../third_party/mozilla/NSPasteboard+Utils.mm',
'../third_party/mozilla/NSScreen+Utils.h',
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 4228bc4..4728861 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -1429,8 +1429,6 @@
'browser/profiles/profile_info_cache_unittest.cc',
'browser/profiles/profile_manager_unittest.cc',
'browser/remoting/firewall_traversal_observer_unittest.cc',
- 'browser/renderer_host/accelerated_plugin_view_mac_unittest.mm',
- 'browser/renderer_host/render_widget_host_view_mac_unittest.mm',
'browser/renderer_host/web_cache_manager_unittest.cc',
'browser/resources_util_unittest.cc',
'browser/rlz/rlz_unittest.cc',
@@ -1656,7 +1654,6 @@
'browser/ui/cocoa/run_loop_testing.h',
'browser/ui/cocoa/run_loop_testing.mm',
'browser/ui/cocoa/run_loop_testing_unittest.mm',
- 'browser/ui/cocoa/rwhvm_editcommand_helper_unittest.mm',
'browser/ui/cocoa/status_bubble_mac_unittest.mm',
'browser/ui/cocoa/status_icons/status_icon_mac_unittest.mm',
'browser/ui/cocoa/styled_text_field_cell_unittest.mm',
diff --git a/content/DEPS b/content/DEPS
index 51bda9a..8742fd4 100644
--- a/content/DEPS
+++ b/content/DEPS
@@ -34,7 +34,9 @@ include_rules = [
"-v8",
"-tools",
+ # Allow inclusion of third-party code:
"+third_party/gpsd",
+ "+third_party/mozilla",
"+third_party/npapi/bindings",
"+third_party/sqlite",
"+third_party/tcmalloc",
diff --git a/chrome/browser/renderer_host/accelerated_plugin_view_mac.h b/content/browser/renderer_host/accelerated_plugin_view_mac.h
index af1b7ca..f404c52 100644
--- a/chrome/browser/renderer_host/accelerated_plugin_view_mac.h
+++ b/content/browser/renderer_host/accelerated_plugin_view_mac.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_RENDERER_HOST_ACCELERATED_PLUGIN_VIEW_MAC_H
-#define CHROME_BROWSER_RENDERER_HOST_ACCELERATED_PLUGIN_VIEW_MAC_H
+#ifndef CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_PLUGIN_VIEW_MAC_H
+#define CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_PLUGIN_VIEW_MAC_H
#import <Cocoa/Cocoa.h>
#include <QuartzCore/QuartzCore.h>
@@ -55,4 +55,4 @@ class RenderWidgetHostViewMac;
@end
-#endif // CHROME_BROWSER_RENDERER_HOST_ACCELERATED_PLUGIN_VIEW_MAC_H
+#endif // CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_PLUGIN_VIEW_MAC_H
diff --git a/chrome/browser/renderer_host/accelerated_plugin_view_mac.mm b/content/browser/renderer_host/accelerated_plugin_view_mac.mm
index 5b08a4b..9bcc433 100644
--- a/chrome/browser/renderer_host/accelerated_plugin_view_mac.mm
+++ b/content/browser/renderer_host/accelerated_plugin_view_mac.mm
@@ -2,13 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#import "chrome/browser/renderer_host/accelerated_plugin_view_mac.h"
+#import "content/browser/renderer_host/accelerated_plugin_view_mac.h"
#include "base/command_line.h"
#include "base/debug/trace_event.h"
-#include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
-#include "chrome/common/chrome_switches.h"
#include "content/browser/browser_thread.h"
+#include "content/browser/renderer_host/render_widget_host_view_mac.h"
#include "ui/gfx/gl/gl_switches.h"
#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
diff --git a/chrome/browser/renderer_host/accelerated_plugin_view_mac_unittest.mm b/content/browser/renderer_host/accelerated_plugin_view_mac_unittest.mm
index a567c46..4d902d2 100644
--- a/chrome/browser/renderer_host/accelerated_plugin_view_mac_unittest.mm
+++ b/content/browser/renderer_host/accelerated_plugin_view_mac_unittest.mm
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/renderer_host/accelerated_plugin_view_mac.h"
+#include "content/browser/renderer_host/accelerated_plugin_view_mac.h"
#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h
index 08b2922..92e48c0 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.h
+++ b/content/browser/renderer_host/render_widget_host_view_mac.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
-#define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
+#ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
+#define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
#pragma once
#import <Cocoa/Cocoa.h>
@@ -24,7 +24,7 @@
@class AcceleratedPluginView;
class RenderWidgetHostViewMac;
@class RenderWidgetHostViewMacDelegate;
-class RWHVMEditCommandHelper;
+class RenderWidgetHostViewMacEditCommandHelper;
@class ToolTip;
@protocol RenderWidgetHostViewMacOwner
@@ -45,7 +45,7 @@ class RWHVMEditCommandHelper;
BOOL canBeKeyView_;
BOOL takesFocusOnlyOnMouseDown_;
BOOL closeOnDeactivate_;
- scoped_ptr<RWHVMEditCommandHelper> editCommand_helper_;
+ scoped_ptr<RenderWidgetHostViewMacEditCommandHelper> editCommand_helper_;
// These are part of the magic tooltip code from WebKit's WebHTMLView:
id trackingRectOwner_; // (not retained)
@@ -407,4 +407,4 @@ class RenderWidgetHostViewMac : public RenderWidgetHostView {
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac);
};
-#endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
+#endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 94530cd..8f720a3 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
+#include "content/browser/renderer_host/render_widget_host_view_mac.h"
#include <QuartzCore/QuartzCore.h>
@@ -16,18 +16,18 @@
#include "base/string_util.h"
#include "base/sys_info.h"
#include "base/sys_string_conversions.h"
-#import "chrome/browser/renderer_host/accelerated_plugin_view_mac.h"
-#import "chrome/browser/ui/cocoa/rwhvm_editcommand_helper.h"
#import "content/browser/accessibility/browser_accessibility_cocoa.h"
#include "content/browser/browser_thread.h"
#include "content/browser/gpu/gpu_process_host.h"
#include "content/browser/gpu/gpu_process_host_ui_shim.h"
#include "content/browser/mac/closure_blocks_leopard_compat.h"
#include "content/browser/plugin_process_host.h"
+#import "content/browser/renderer_host/accelerated_plugin_view_mac.h"
#include "content/browser/renderer_host/backing_store_mac.h"
#include "content/browser/renderer_host/render_process_host.h"
#include "content/browser/renderer_host/render_view_host.h"
#import "content/browser/renderer_host/render_widget_host_view_mac_delegate.h"
+#import "content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper.h"
#import "content/browser/renderer_host/text_input_client_mac.h"
#include "content/common/edit_command.h"
#include "content/common/gpu/gpu_messages.h"
@@ -1112,7 +1112,7 @@ void RenderWidgetHostViewMac::SetTextInputActive(bool active) {
- (id)initWithRenderWidgetHostViewMac:(RenderWidgetHostViewMac*)r {
self = [super initWithFrame:NSZeroRect];
if (self) {
- editCommand_helper_.reset(new RWHVMEditCommandHelper);
+ editCommand_helper_.reset(new RenderWidgetHostViewMacEditCommandHelper);
editCommand_helper_->AddEditingSelectorsToClass([self class]);
renderWidgetHostView_.reset(r);
@@ -2459,7 +2459,8 @@ extern NSString *NSTextInputReplacementRangeAttributeName;
return;
std::string command(
- [RWHVMEditCommandHelper::CommandNameForSelector(selector) UTF8String]);
+ [RenderWidgetHostViewMacEditCommandHelper::
+ CommandNameForSelector(selector) UTF8String]);
// If this method is called when handling a key down event, then we need to
// handle the command in the key event handler. Otherwise we can just handle
diff --git a/chrome/browser/ui/cocoa/rwhvm_editcommand_helper.h b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper.h
index 85b572a..bdafbaf 100644
--- a/chrome/browser/ui/cocoa/rwhvm_editcommand_helper.h
+++ b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// 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.
-#ifndef CHROME_BROWSER_UI_COCOA_RWHVM_EDITCOMMAND_HELPER_H_
-#define CHROME_BROWSER_UI_COCOA_RWHVM_EDITCOMMAND_HELPER_H_
+#ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_EDITCOMMAND_HELPER_H_
+#define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_EDITCOMMAND_HELPER_H_
#pragma once
#import <Cocoa/Cocoa.h>
@@ -11,11 +11,8 @@
#include "base/basictypes.h"
#include "base/hash_tables.h"
#include "base/gtest_prod_util.h"
-#include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
+#include "content/browser/renderer_host/render_widget_host_view_mac.h"
-// RenderWidgetHostViewMacEditCommandHelper is the real name of this class
-// but that's too long, so we use a shorter version.
-//
// This class mimics the behavior of WebKit's WebView class in a way that makes
// sense for Chrome.
//
@@ -30,15 +27,15 @@
// (note that this is not a misspelling of RenderWidgetHostViewMac, it's in
// fact a distinct object) When these selectors are called, the relevant
// edit command is executed in WebCore.
-class RWHVMEditCommandHelper {
- FRIEND_TEST_ALL_PREFIXES(RWHVMEditCommandHelperTest,
+class RenderWidgetHostViewMacEditCommandHelper {
+ FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewMacEditCommandHelperTest,
TestAddEditingSelectorsToClass);
- FRIEND_TEST_ALL_PREFIXES(RWHVMEditCommandHelperTest,
+ FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewMacEditCommandHelperTest,
TestEditingCommandDelivery);
public:
- RWHVMEditCommandHelper();
- ~RWHVMEditCommandHelper();
+ RenderWidgetHostViewMacEditCommandHelper();
+ ~RenderWidgetHostViewMacEditCommandHelper();
// Adds editing selectors to the objc class using the objc runtime APIs.
// Each selector is connected to a single c method which forwards the message
@@ -67,7 +64,7 @@ class RWHVMEditCommandHelper {
private:
base::hash_set<std::string> edit_command_set_;
- DISALLOW_COPY_AND_ASSIGN(RWHVMEditCommandHelper);
+ DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMacEditCommandHelper);
};
-#endif // CHROME_BROWSER_UI_COCOA_RWHVM_EDITCOMMAND_HELPER_H_
+#endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_EDITCOMMAND_HELPER_H_
diff --git a/chrome/browser/ui/cocoa/rwhvm_editcommand_helper.mm b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper.mm
index 8d24804..4ad3b76 100644
--- a/chrome/browser/ui/cocoa/rwhvm_editcommand_helper.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper.mm
@@ -1,13 +1,13 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// 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.
-#import "chrome/browser/ui/cocoa/rwhvm_editcommand_helper.h"
+#import "content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper.h"
#import <objc/runtime.h>
-#import "chrome/browser/renderer_host/render_widget_host_view_mac.h"
#include "content/browser/renderer_host/render_widget_host.h"
+#import "content/browser/renderer_host/render_widget_host_view_mac.h"
namespace {
// The names of all the objc selectors w/o ':'s added to an object by
@@ -109,7 +109,7 @@ const char* kEditCommands[] = {
// This function is installed via the objc runtime as the implementation of all
// the various editing selectors.
// The objc runtime hookup occurs in
-// RWHVMEditCommandHelper::AddEditingSelectorsToClass().
+// RenderWidgetHostViewMacEditCommandHelper::AddEditingSelectorsToClass().
//
// self - the object we're attached to; it must implement the
// RenderWidgetHostViewMacOwner protocol.
@@ -129,7 +129,7 @@ void EditCommandImp(id self, SEL _cmd, id sender) {
// SEL -> command name string.
NSString* command_name_ns =
- RWHVMEditCommandHelper::CommandNameForSelector(_cmd);
+ RenderWidgetHostViewMacEditCommandHelper::CommandNameForSelector(_cmd);
std::string command([command_name_ns UTF8String]);
// Forward the edit command string down the pipeline.
@@ -153,7 +153,8 @@ void EditCommandImp(id self, SEL _cmd, id sender) {
// WebKit/mac/WebView/WebHTMLView.mm .
// Capitalized names are returned from this function, but that's simply
// matching WebHTMLView.mm.
-NSString* RWHVMEditCommandHelper::CommandNameForSelector(SEL selector) {
+NSString* RenderWidgetHostViewMacEditCommandHelper::CommandNameForSelector(
+ SEL selector) {
if (selector == @selector(insertParagraphSeparator:) ||
selector == @selector(insertNewlineIgnoringFieldEditor:))
return @"InsertNewline";
@@ -174,16 +175,19 @@ NSString* RWHVMEditCommandHelper::CommandNameForSelector(SEL selector) {
return [selector_str substringToIndex:selector_len - 1];
}
-RWHVMEditCommandHelper::RWHVMEditCommandHelper() {
+RenderWidgetHostViewMacEditCommandHelper::
+ RenderWidgetHostViewMacEditCommandHelper() {
for (size_t i = 0; i < arraysize(kEditCommands); ++i) {
edit_command_set_.insert(kEditCommands[i]);
}
}
-RWHVMEditCommandHelper::~RWHVMEditCommandHelper() {}
+RenderWidgetHostViewMacEditCommandHelper::
+ ~RenderWidgetHostViewMacEditCommandHelper() {}
// Dynamically adds Selectors to the aformentioned class.
-void RWHVMEditCommandHelper::AddEditingSelectorsToClass(Class klass) {
+void RenderWidgetHostViewMacEditCommandHelper::AddEditingSelectorsToClass(
+ Class klass) {
for (size_t i = 0; i < arraysize(kEditCommands); ++i) {
// Append trailing ':' to command name to get selector name.
NSString* sel_str = [NSString stringWithFormat: @"%s:", kEditCommands[i]];
@@ -198,7 +202,8 @@ void RWHVMEditCommandHelper::AddEditingSelectorsToClass(Class klass) {
}
}
-bool RWHVMEditCommandHelper::IsMenuItemEnabled(SEL item_action,
+bool RenderWidgetHostViewMacEditCommandHelper::IsMenuItemEnabled(
+ SEL item_action,
id<RenderWidgetHostViewMacOwner> owner) {
const char* selector_name = sel_getName(item_action);
// TODO(jeremy): The final form of this function will check state
@@ -218,7 +223,7 @@ bool RWHVMEditCommandHelper::IsMenuItemEnabled(SEL item_action,
return ret;
}
-NSArray* RWHVMEditCommandHelper::GetEditSelectorNames() {
+NSArray* RenderWidgetHostViewMacEditCommandHelper::GetEditSelectorNames() {
size_t num_edit_commands = arraysize(kEditCommands);
NSMutableArray* ret = [NSMutableArray arrayWithCapacity:num_edit_commands];
diff --git a/chrome/browser/ui/cocoa/rwhvm_editcommand_helper_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
index de32f41..c81cc83 100644
--- a/chrome/browser/ui/cocoa/rwhvm_editcommand_helper_unittest.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
@@ -1,28 +1,28 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// 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.
-#import "chrome/browser/ui/cocoa/rwhvm_editcommand_helper.h"
+#import "content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper.h"
#import <Cocoa/Cocoa.h>
#include "base/message_loop.h"
-#include "chrome/test/base/testing_profile.h"
#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/browser/renderer_host/render_widget_host.h"
#include "content/common/view_messages.h"
+#include "content/test/test_browser_context.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
-class RWHVMEditCommandHelperTest : public PlatformTest {
+class RenderWidgetHostViewMacEditCommandHelperTest : public PlatformTest {
};
// Bare bones obj-c class for testing purposes.
-@interface RWHVMEditCommandHelperTestClass : NSObject
+@interface RenderWidgetHostViewMacEditCommandHelperTestClass : NSObject
@end
-@implementation RWHVMEditCommandHelperTestClass
+@implementation RenderWidgetHostViewMacEditCommandHelperTestClass
@end
// Class that owns a RenderWidgetHostViewMac.
@@ -31,7 +31,7 @@ class RWHVMEditCommandHelperTest : public PlatformTest {
RenderWidgetHostViewMac* rwhvm_;
}
-- (id) initWithRenderWidgetHostViewMac:(RenderWidgetHostViewMac*)rwhvm;
+- (id)initWithRenderWidgetHostViewMac:(RenderWidgetHostViewMac*)rwhvm;
@end
@implementation RenderWidgetHostViewMacOwner
@@ -55,7 +55,8 @@ namespace {
// in test_obj.
// edit_commands is a list of NSStrings, selector names are formed by
// appending a trailing ':' to the string.
- bool CheckObjectRespondsToEditCommands(NSArray* edit_commands, id test_obj) {
+ bool CheckObjectRespondsToEditCommands(NSArray* edit_commands,
+ id test_obj) {
for (NSString* edit_command_name in edit_commands) {
NSString* sel_str = [edit_command_name stringByAppendingString:@":"];
if (![test_obj respondsToSelector:NSSelectorFromString(sel_str)]) {
@@ -89,14 +90,15 @@ class RenderWidgetHostEditCommandCounter : public RenderWidgetHost {
// Tests that editing commands make it through the pipeline all the way to
// RenderWidgetHost.
// Disabled, http://crbug.com/93286.
-TEST_F(RWHVMEditCommandHelperTest, DISABLED_TestEditingCommandDelivery) {
- RWHVMEditCommandHelper helper;
+TEST_F(RenderWidgetHostViewMacEditCommandHelperTest,
+ DISABLED_TestEditingCommandDelivery) {
+ RenderWidgetHostViewMacEditCommandHelper helper;
NSArray* edit_command_strings = helper.GetEditSelectorNames();
// Set up a mock render widget and set expectations.
MessageLoopForUI message_loop;
- TestingProfile profile;
- MockRenderProcessHost mock_process(&profile);
+ TestBrowserContext browser_context;
+ MockRenderProcessHost mock_process(&browser_context);
RenderWidgetHostEditCommandCounter render_widget(&mock_process, 0);
// RenderWidgetHostViewMac self destructs (RenderWidgetHostViewMacCocoa
@@ -118,15 +120,17 @@ TEST_F(RWHVMEditCommandHelperTest, DISABLED_TestEditingCommandDelivery) {
EXPECT_EQ(render_widget.edit_command_message_count_, num_edit_commands);
}
-// Test RWHVMEditCommandHelper::AddEditingSelectorsToClass
-TEST_F(RWHVMEditCommandHelperTest, TestAddEditingSelectorsToClass) {
- RWHVMEditCommandHelper helper;
+// Test RenderWidgetHostViewMacEditCommandHelper::AddEditingSelectorsToClass
+TEST_F(RenderWidgetHostViewMacEditCommandHelperTest,
+ TestAddEditingSelectorsToClass) {
+ RenderWidgetHostViewMacEditCommandHelper helper;
NSArray* edit_command_strings = helper.GetEditSelectorNames();
ASSERT_GT([edit_command_strings count], 0U);
// Create a class instance and add methods to the class.
- RWHVMEditCommandHelperTestClass* test_obj =
- [[[RWHVMEditCommandHelperTestClass alloc] init] autorelease];
+ RenderWidgetHostViewMacEditCommandHelperTestClass* test_obj =
+ [[[RenderWidgetHostViewMacEditCommandHelperTestClass alloc] init]
+ autorelease];
// Check that edit commands aren't already attached to the object.
ASSERT_FALSE(CheckObjectRespondsToEditCommands(edit_command_strings,
@@ -146,9 +150,9 @@ TEST_F(RWHVMEditCommandHelperTest, TestAddEditingSelectorsToClass) {
test_obj));
}
-// Test RWHVMEditCommandHelper::IsMenuItemEnabled.
-TEST_F(RWHVMEditCommandHelperTest, TestMenuItemEnabling) {
- RWHVMEditCommandHelper helper;
+// Test RenderWidgetHostViewMacEditCommandHelper::IsMenuItemEnabled.
+TEST_F(RenderWidgetHostViewMacEditCommandHelperTest, TestMenuItemEnabling) {
+ RenderWidgetHostViewMacEditCommandHelper helper;
RenderWidgetHostViewMacOwner* rwhvm_owner =
[[[RenderWidgetHostViewMacOwner alloc] init] autorelease];
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
index 5ee505c5..43e5300 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac_unittest.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
@@ -2,22 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
+#include "content/browser/renderer_host/render_widget_host_view_mac.h"
#include "base/mac/scoped_nsautorelease_pool.h"
-#import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
-#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "content/browser/browser_thread.h"
+#include "content/browser/renderer_host/test_render_view_host.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/test/cocoa_test_event_utils.h"
+#import "ui/base/test/ui_cocoa_test_helper.h"
#include "webkit/plugins/npapi/webplugin.h"
-class RenderWidgetHostViewMacTest : public ChromeRenderViewHostTestHarness {
+class RenderWidgetHostViewMacTest : public RenderViewHostTestHarness {
public:
RenderWidgetHostViewMacTest() : old_rwhv_(NULL), rwhv_mac_(NULL) {}
virtual void SetUp() {
- ChromeRenderViewHostTestHarness::SetUp();
+ RenderViewHostTestHarness::SetUp();
// TestRenderViewHost's destruction assumes that its view is a
// TestRenderWidgetHostView, so store its view and reset it back to the
@@ -38,7 +38,7 @@ class RenderWidgetHostViewMacTest : public ChromeRenderViewHostTestHarness {
MessageLoop::current()->RunAllPending();
pool_.Recycle();
- ChromeRenderViewHostTestHarness::TearDown();
+ RenderViewHostTestHarness::TearDown();
}
protected:
// Adds an accelerated plugin view to |rwhv_cocoa_|. Returns a handle to the
diff --git a/content/content_browser.gypi b/content/content_browser.gypi
index 1051cbc..e18fd38 100644
--- a/content/content_browser.gypi
+++ b/content/content_browser.gypi
@@ -293,6 +293,8 @@
'browser/plugin_service.h',
'browser/plugin_service_filter.h',
'browser/quota_permission_context.h',
+ 'browser/renderer_host/accelerated_plugin_view_mac.h',
+ 'browser/renderer_host/accelerated_plugin_view_mac.mm',
'browser/renderer_host/accelerated_surface_container_mac.cc',
'browser/renderer_host/accelerated_surface_container_mac.h',
'browser/renderer_host/accelerated_surface_container_manager_mac.cc',
@@ -402,7 +404,11 @@
'browser/renderer_host/render_widget_host_view.h',
'browser/renderer_host/render_widget_host_view_gtk.cc',
'browser/renderer_host/render_widget_host_view_gtk.h',
+ 'browser/renderer_host/render_widget_host_view_mac.h',
+ 'browser/renderer_host/render_widget_host_view_mac.mm',
'browser/renderer_host/render_widget_host_view_mac_delegate.h',
+ 'browser/renderer_host/render_widget_host_view_mac_editcommand_helper.h',
+ 'browser/renderer_host/render_widget_host_view_mac_editcommand_helper.mm',
'browser/renderer_host/render_widget_host_view_win.cc',
'browser/renderer_host/render_widget_host_view_win.h',
'browser/renderer_host/resource_dispatcher_host.cc',
@@ -599,12 +605,20 @@
'sources!': [
'browser/power_save_blocker_stub.cc',
],
+ 'sources': [
+ # Build necessary Mozilla sources
+ '../third_party/mozilla/ComplexTextInputPanel.h',
+ '../third_party/mozilla/ComplexTextInputPanel.mm',
+ ],
'link_settings': {
'mac_bundle_resources': [
'browser/gpu.sb',
'browser/worker.sb',
],
},
+ 'dependencies': [
+ 'closure_blocks_leopard_compat',
+ ],
}, { # OS!="mac"
'dependencies': [
'../sandbox/sandbox.gyp:sandbox',
diff --git a/content/content_tests.gypi b/content/content_tests.gypi
index c6224ee..bc67eb2 100644
--- a/content/content_tests.gypi
+++ b/content/content_tests.gypi
@@ -12,6 +12,7 @@
'../skia/skia.gyp:skia',
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
+ '../ui/ui.gyp:ui_test_support',
],
'include_dirs': [
'..',
@@ -119,6 +120,7 @@
'browser/in_process_webkit/webkit_thread_unittest.cc',
'browser/mac/closure_blocks_leopard_compat_unittest.cc',
'browser/mach_broker_mac_unittest.cc',
+ 'browser/renderer_host/accelerated_plugin_view_mac_unittest.mm',
'browser/renderer_host/gtk_key_bindings_handler_unittest.cc',
'browser/renderer_host/media/audio_input_device_manager_unittest.cc',
'browser/renderer_host/media/audio_renderer_host_unittest.cc',
@@ -126,6 +128,8 @@
'browser/renderer_host/media/video_capture_host_unittest.cc',
'browser/renderer_host/media/video_capture_manager_unittest.cc',
'browser/renderer_host/render_view_host_unittest.cc',
+ 'browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm',
+ 'browser/renderer_host/render_widget_host_view_mac_unittest.mm',
'browser/renderer_host/resource_dispatcher_host_unittest.cc',
'browser/renderer_host/resource_queue_unittest.cc',
'browser/resolve_proxy_msg_helper_unittest.cc',