Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3084)

Unified Diff: chrome/browser/browser.cc

Issue 171079: more linux automation porting: SendKeyPressNotifyWhenDone... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser.h ('k') | chrome/browser/browser_focus_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.cc
===================================================================
--- chrome/browser/browser.cc (revision 23591)
+++ chrome/browser/browser.cc (working copy)
@@ -8,6 +8,7 @@
#include "app/l10n_util.h"
#include "base/command_line.h"
#include "base/idle_timer.h"
+#include "base/keyboard_codes.h"
#include "base/logging.h"
#include "base/string_util.h"
#include "base/thread.h"
@@ -1019,44 +1020,20 @@
void Browser::Cut() {
UserMetrics::RecordAction(L"Cut", profile_);
- ui_controls::SendKeyPress(window()->GetNativeHandle(), L'X', true, false,
- false);
+ ui_controls::SendKeyPress(window()->GetNativeHandle(), base::VKEY_X, true,
+ false, false);
}
void Browser::Copy() {
UserMetrics::RecordAction(L"Copy", profile_);
- ui_controls::SendKeyPress(window()->GetNativeHandle(), L'C', true, false,
- false);
+ ui_controls::SendKeyPress(window()->GetNativeHandle(), base::VKEY_C, true,
+ false, false);
}
-void Browser::CopyCurrentPageURL() {
- UserMetrics::RecordAction(L"CopyURLToClipBoard", profile_);
- std::string url = GetSelectedTabContents()->GetURL().spec();
-
- if (!::OpenClipboard(NULL)) {
- NOTREACHED();
- return;
- }
-
- if (::EmptyClipboard()) {
- HGLOBAL text = ::GlobalAlloc(GMEM_MOVEABLE, url.size() + 1);
- LPSTR ptr = static_cast<LPSTR>(::GlobalLock(text));
- memcpy(ptr, url.c_str(), url.size());
- ptr[url.size()] = '\0';
- ::GlobalUnlock(text);
-
- ::SetClipboardData(CF_TEXT, text);
- }
-
- if (!::CloseClipboard()) {
- NOTREACHED();
- }
-}
-
void Browser::Paste() {
UserMetrics::RecordAction(L"Paste", profile_);
- ui_controls::SendKeyPress(window()->GetNativeHandle(), L'V', true, false,
- false);
+ ui_controls::SendKeyPress(window()->GetNativeHandle(), base::VKEY_V, true,
+ false, false);
}
#endif // #if defined(OS_WIN)
@@ -1389,7 +1366,6 @@
// Clipboard commands
case IDC_CUT: Cut(); break;
case IDC_COPY: Copy(); break;
- case IDC_COPY_URL: CopyCurrentPageURL(); break;
case IDC_PASTE: Paste(); break;
#endif
« no previous file with comments | « chrome/browser/browser.h ('k') | chrome/browser/browser_focus_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698