diff options
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r-- | chrome/browser/browser.cc | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index fa5b781..d6d9122 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -83,7 +83,6 @@ #include <shellapi.h> #include "app/win_util.h" -#include "chrome/browser/automation/ui_controls.h" #include "chrome/browser/browser_url_handler.h" #include "chrome/browser/cert_store.h" #include "chrome/browser/download/save_package.h" @@ -96,10 +95,6 @@ #include "chrome/common/child_process_host.h" #endif // OS_WIN -#if defined(OS_CHROMEOS) -#include "chrome/browser/automation/ui_controls.h" -#endif - #if !defined(OS_MACOSX) #include "chrome/browser/dock_info.h" #endif @@ -1109,38 +1104,22 @@ void Browser::OverrideEncoding(int encoding_id) { } } -#if defined(OS_WIN) || defined(OS_CHROMEOS) -// TODO(devint): http://b/issue?id=1117225 Cut, Copy, and Paste are always -// enabled in the page menu regardless of whether the command will do -// anything. When someone selects the menu item, we just act as if they hit -// the keyboard shortcut for the command by sending the associated key press -// to windows. The real fix to this bug is to disable the commands when they -// won't do anything. We'll need something like an overall clipboard command -// manager to do that. - -// TODO(oshima): Enabling this for chromeos, but not for linux. It's safe -// to assume ctrl-x/c/v are cut, copy and paste on chromeos, but not on -// linux. See http://crbug.com/18030. We should switch to whatever linux/gtk -// will implement. - +#if !defined(OS_MACOSX) void Browser::Cut() { UserMetrics::RecordAction("Cut", profile_); - ui_controls::SendKeyPress(window()->GetNativeHandle(), base::VKEY_X, true, - false, false); + window()->Cut(); } void Browser::Copy() { UserMetrics::RecordAction("Copy", profile_); - ui_controls::SendKeyPress(window()->GetNativeHandle(), base::VKEY_C, true, - false, false); + window()->Copy(); } void Browser::Paste() { UserMetrics::RecordAction("Paste", profile_); - ui_controls::SendKeyPress(window()->GetNativeHandle(), base::VKEY_V, true, - false, false); + window()->Paste(); } -#endif // #if defined(OS_WIN) || defined(OS_CHROMEOS) +#endif void Browser::Find() { UserMetrics::RecordAction("Find", profile_); @@ -1549,7 +1528,7 @@ void Browser::ExecuteCommandWithDisposition( case IDC_ENCODING_WINDOWS1255: case IDC_ENCODING_WINDOWS1258: OverrideEncoding(id); break; -#if defined(OS_WIN) || defined(OS_CHROMEOS) +#if !defined(OS_MACOSX) // Clipboard commands case IDC_CUT: Cut(); break; case IDC_COPY: Copy(); break; |