Rename "CheckWritable" to "PrepareForWritableApp" to reflect the actual behavior.

The existing implementation in fact does not check whether the file is
writable or not (see below for the detail.)
Since the current behavior itself is fine for the use cases,
this CL renames the relevant functions, and refactors the implementation
so that the intent is clearer.

Existing implementation tries to open a file with CREATE|READ|WRITE flags
and verifies that the result is either FILE_OK or ALREADY_EXISTS.

This _succeeds_ when read-only file already existed at the location
because ALREADY_EXISTS error precedes write failure.
Considering the fact, it is essentially equivalent to open with OPEN_ALWAYS|READ
and comparing the result just against FILE_OK.

BUG=367028

Review URL: https://codereview.chromium.org/306073004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274485 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/apps/launcher.cc b/apps/launcher.cc
index acaec41..f357881 100644
--- a/apps/launcher.cc
+++ b/apps/launcher.cc
@@ -46,7 +46,7 @@
 
 using apps::file_handler_util::GrantedFileEntry;
 using content::BrowserThread;
-using extensions::app_file_handler_util::CheckWritableFiles;
+using extensions::app_file_handler_util::PrepareFilesForWritableApp;
 using extensions::app_file_handler_util::FileHandlerForId;
 using extensions::app_file_handler_util::FileHandlerCanHandleFile;
 using extensions::app_file_handler_util::FirstFileHandlerForFile;
@@ -114,7 +114,7 @@
     if (HasFileSystemWritePermission(extension_)) {
       std::vector<base::FilePath> paths;
       paths.push_back(file_path_);
-      CheckWritableFiles(
+      PrepareFilesForWritableApp(
           paths,
           profile_,
           false,