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

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

Issue 211383007: Use FilePaths in content::DropData to avoid redundant conversions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang-format Created 6 years, 8 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
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 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 content::DropData drop_data; 908 content::DropData drop_data;
909 for (size_t path_index = 0; path_index < paths->GetSize(); ++path_index) { 909 for (size_t path_index = 0; path_index < paths->GetSize(); ++path_index) {
910 base::string16 path; 910 base::string16 path;
911 if (!paths->GetString(path_index, &path)) { 911 if (!paths->GetString(path_index, &path)) {
912 AutomationJSONReply(this, reply_message) 912 AutomationJSONReply(this, reply_message)
913 .SendError("'paths' contains a non-string type"); 913 .SendError("'paths' contains a non-string type");
914 return; 914 return;
915 } 915 }
916 916
917 drop_data.filenames.push_back( 917 drop_data.filenames.push_back(
918 content::DropData::FileInfo(path, base::string16())); 918 ui::FileInfo(base::FilePath::FromUTF16Unsafe(path), base::FilePath()));
919 } 919 }
920 920
921 const gfx::Point client(x, y); 921 const gfx::Point client(x, y);
922 // We don't set any values in screen variable because DragTarget*** ignore the 922 // We don't set any values in screen variable because DragTarget*** ignore the
923 // screen argument. 923 // screen argument.
924 const gfx::Point screen; 924 const gfx::Point screen;
925 925
926 int operations = 0; 926 int operations = 0;
927 operations |= blink::WebDragOperationCopy; 927 operations |= blink::WebDragOperationCopy;
928 operations |= blink::WebDragOperationLink; 928 operations |= blink::WebDragOperationLink;
(...skipping 4311 matching lines...) Expand 10 before | Expand all | Expand 10 after
5240 if (g_browser_process) 5240 if (g_browser_process)
5241 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 5241 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
5242 } 5242 }
5243 5243
5244 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, 5244 void TestingAutomationProvider::EnsureTabSelected(Browser* browser,
5245 WebContents* tab) { 5245 WebContents* tab) {
5246 TabStripModel* tab_strip = browser->tab_strip_model(); 5246 TabStripModel* tab_strip = browser->tab_strip_model();
5247 if (tab_strip->GetActiveWebContents() != tab) 5247 if (tab_strip->GetActiveWebContents() != tab)
5248 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); 5248 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true);
5249 } 5249 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/drag_download_item_views.cc » ('j') | ui/base/dragdrop/file_info.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698