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

Side by Side Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 18281002: Move WebDropData to content::DropData and split off conversion function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Mac build error. Created 7 years, 5 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 | « no previous file | chrome/browser/ui/aura/tab_contents/web_drag_bookmark_handler_aura.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/automation/testing_automation_provider.h" 5 #include "chrome/browser/automation/testing_automation_provider.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 #include "content/public/browser/interstitial_page_delegate.h" 129 #include "content/public/browser/interstitial_page_delegate.h"
130 #include "content/public/browser/navigation_entry.h" 130 #include "content/public/browser/navigation_entry.h"
131 #include "content/public/browser/notification_service.h" 131 #include "content/public/browser/notification_service.h"
132 #include "content/public/browser/plugin_service.h" 132 #include "content/public/browser/plugin_service.h"
133 #include "content/public/browser/render_process_host.h" 133 #include "content/public/browser/render_process_host.h"
134 #include "content/public/browser/render_view_host.h" 134 #include "content/public/browser/render_view_host.h"
135 #include "content/public/browser/render_widget_host_view.h" 135 #include "content/public/browser/render_widget_host_view.h"
136 #include "content/public/browser/web_contents.h" 136 #include "content/public/browser/web_contents.h"
137 #include "content/public/common/child_process_host.h" 137 #include "content/public/common/child_process_host.h"
138 #include "content/public/common/common_param_traits.h" 138 #include "content/public/common/common_param_traits.h"
139 #include "content/public/common/drop_data.h"
139 #include "content/public/common/geoposition.h" 140 #include "content/public/common/geoposition.h"
140 #include "content/public/common/ssl_status.h" 141 #include "content/public/common/ssl_status.h"
141 #include "extensions/browser/view_type_utils.h" 142 #include "extensions/browser/view_type_utils.h"
142 #include "extensions/common/url_pattern.h" 143 #include "extensions/common/url_pattern.h"
143 #include "extensions/common/url_pattern_set.h" 144 #include "extensions/common/url_pattern_set.h"
144 #include "net/cookies/cookie_store.h" 145 #include "net/cookies/cookie_store.h"
145 #include "third_party/WebKit/public/web/WebInputEvent.h" 146 #include "third_party/WebKit/public/web/WebInputEvent.h"
146 #include "ui/base/events/event_constants.h" 147 #include "ui/base/events/event_constants.h"
147 #include "ui/base/keycodes/keyboard_codes.h" 148 #include "ui/base/keycodes/keyboard_codes.h"
148 #include "ui/base/ui_base_types.h" 149 #include "ui/base/ui_base_types.h"
149 #include "webkit/common/webdropdata.h"
150 #include "webkit/plugins/webplugininfo.h" 150 #include "webkit/plugins/webplugininfo.h"
151 151
152 #if defined(ENABLE_CONFIGURATION_POLICY) 152 #if defined(ENABLE_CONFIGURATION_POLICY)
153 #include "chrome/browser/policy/policy_service.h" 153 #include "chrome/browser/policy/policy_service.h"
154 #endif 154 #endif
155 155
156 #if defined(OS_CHROMEOS) 156 #if defined(OS_CHROMEOS)
157 #include "chromeos/dbus/dbus_thread_manager.h" 157 #include "chromeos/dbus/dbus_thread_manager.h"
158 #endif 158 #endif
159 159
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 } 936 }
937 937
938 ListValue* paths = NULL; 938 ListValue* paths = NULL;
939 if (!args->GetList("paths", &paths)) { 939 if (!args->GetList("paths", &paths)) {
940 AutomationJSONReply(this, reply_message) 940 AutomationJSONReply(this, reply_message)
941 .SendError("'paths' missing or invalid"); 941 .SendError("'paths' missing or invalid");
942 return; 942 return;
943 } 943 }
944 944
945 // Emulate drag and drop to set the file paths to the file upload control. 945 // Emulate drag and drop to set the file paths to the file upload control.
946 WebDropData drop_data; 946 content::DropData drop_data;
947 for (size_t path_index = 0; path_index < paths->GetSize(); ++path_index) { 947 for (size_t path_index = 0; path_index < paths->GetSize(); ++path_index) {
948 string16 path; 948 string16 path;
949 if (!paths->GetString(path_index, &path)) { 949 if (!paths->GetString(path_index, &path)) {
950 AutomationJSONReply(this, reply_message) 950 AutomationJSONReply(this, reply_message)
951 .SendError("'paths' contains a non-string type"); 951 .SendError("'paths' contains a non-string type");
952 return; 952 return;
953 } 953 }
954 954
955 drop_data.filenames.push_back( 955 drop_data.filenames.push_back(
956 WebDropData::FileInfo(path, string16())); 956 content::DropData::FileInfo(path, string16()));
957 } 957 }
958 958
959 const gfx::Point client(x, y); 959 const gfx::Point client(x, y);
960 // We don't set any values in screen variable because DragTarget*** ignore the 960 // We don't set any values in screen variable because DragTarget*** ignore the
961 // screen argument. 961 // screen argument.
962 const gfx::Point screen; 962 const gfx::Point screen;
963 963
964 int operations = 0; 964 int operations = 0;
965 operations |= WebKit::WebDragOperationCopy; 965 operations |= WebKit::WebDragOperationCopy;
966 operations |= WebKit::WebDragOperationLink; 966 operations |= WebKit::WebDragOperationLink;
(...skipping 4726 matching lines...) Expand 10 before | Expand all | Expand 10 after
5693 if (g_browser_process) 5693 if (g_browser_process)
5694 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 5694 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
5695 } 5695 }
5696 5696
5697 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, 5697 void TestingAutomationProvider::EnsureTabSelected(Browser* browser,
5698 WebContents* tab) { 5698 WebContents* tab) {
5699 TabStripModel* tab_strip = browser->tab_strip_model(); 5699 TabStripModel* tab_strip = browser->tab_strip_model();
5700 if (tab_strip->GetActiveWebContents() != tab) 5700 if (tab_strip->GetActiveWebContents() != tab)
5701 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); 5701 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true);
5702 } 5702 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/aura/tab_contents/web_drag_bookmark_handler_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698