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

Side by Side Diff: chrome/browser/views/frame/browser_view.cc

Issue 1701006: Implement UI automation on the Mac.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/views/find_bar_host_interactive_uitest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/views/frame/browser_view.h" 5 #include "chrome/browser/views/frame/browser_view.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 } 1184 }
1185 #endif 1185 #endif
1186 1186
1187 // TODO(devint): http://b/issue?id=1117225 Cut, Copy, and Paste are always 1187 // TODO(devint): http://b/issue?id=1117225 Cut, Copy, and Paste are always
1188 // enabled in the page menu regardless of whether the command will do 1188 // enabled in the page menu regardless of whether the command will do
1189 // anything. When someone selects the menu item, we just act as if they hit 1189 // anything. When someone selects the menu item, we just act as if they hit
1190 // the keyboard shortcut for the command by sending the associated key press 1190 // the keyboard shortcut for the command by sending the associated key press
1191 // to windows. The real fix to this bug is to disable the commands when they 1191 // to windows. The real fix to this bug is to disable the commands when they
1192 // won't do anything. We'll need something like an overall clipboard command 1192 // won't do anything. We'll need something like an overall clipboard command
1193 // manager to do that. 1193 // manager to do that.
1194 #if !defined(OS_MACOSX)
1194 void BrowserView::Cut() { 1195 void BrowserView::Cut() {
1195 ui_controls::SendKeyPress(GetNativeHandle(), base::VKEY_X, true, 1196 ui_controls::SendKeyPress(GetNativeHandle(), base::VKEY_X,
1196 false, false); 1197 true, false, false, false);
1197 } 1198 }
1198 1199
1199 void BrowserView::Copy() { 1200 void BrowserView::Copy() {
1200 ui_controls::SendKeyPress(GetNativeHandle(), base::VKEY_C, true, 1201 ui_controls::SendKeyPress(GetNativeHandle(), base::VKEY_C,
1201 false, false); 1202 true, false, false, false);
1202 } 1203 }
1203 1204
1204 void BrowserView::Paste() { 1205 void BrowserView::Paste() {
1205 ui_controls::SendKeyPress(GetNativeHandle(), base::VKEY_V, true, 1206 ui_controls::SendKeyPress(GetNativeHandle(), base::VKEY_V,
1206 false, false); 1207 true, false, false, false);
1207 } 1208 }
1209 #else
1210 // Mac versions. Not tested by antyhing yet;
1211 // don't assume written == works.
1212 void BrowserView::Cut() {
1213 ui_controls::SendKeyPress(GetNativeHandle(), base::VKEY_X,
1214 false, false, false, true);
1215 }
1216
1217 void BrowserView::Copy() {
1218 ui_controls::SendKeyPress(GetNativeHandle(), base::VKEY_C,
1219 false, false, false, true);
1220 }
1221
1222 void BrowserView::Paste() {
1223 ui_controls::SendKeyPress(GetNativeHandle(), base::VKEY_V,
1224 false, false, false, true);
1225 }
1226 #endif
1208 1227
1209 /////////////////////////////////////////////////////////////////////////////// 1228 ///////////////////////////////////////////////////////////////////////////////
1210 // BrowserView, BrowserWindowTesting implementation: 1229 // BrowserView, BrowserWindowTesting implementation:
1211 1230
1212 BookmarkBarView* BrowserView::GetBookmarkBarView() const { 1231 BookmarkBarView* BrowserView::GetBookmarkBarView() const {
1213 return bookmark_bar_view_.get(); 1232 return bookmark_bar_view_.get();
1214 } 1233 }
1215 1234
1216 LocationBarView* BrowserView::GetLocationBarView() const { 1235 LocationBarView* BrowserView::GetLocationBarView() const {
1217 return toolbar_->location_bar(); 1236 return toolbar_->location_bar();
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
2179 SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME)); 2198 SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME));
2180 2199
2181 return view; 2200 return view;
2182 } 2201 }
2183 #endif 2202 #endif
2184 2203
2185 // static 2204 // static
2186 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { 2205 FindBar* BrowserWindow::CreateFindBar(Browser* browser) {
2187 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); 2206 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window()));
2188 } 2207 }
OLDNEW
« no previous file with comments | « chrome/browser/views/find_bar_host_interactive_uitest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698