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

Side by Side Diff: chrome/browser/chromeos/drive/file_change.cc

Issue 676403003: Revert of Changed api to notify when watched directory is deleted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_manager/event_router.h » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chromeos/drive/file_change.h" 5 #include "chrome/browser/chromeos/drive/file_change.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 void FileChange::Update(const base::FilePath file_path, 109 void FileChange::Update(const base::FilePath file_path,
110 FileType file_type, 110 FileType file_type,
111 FileChange::ChangeType change) { 111 FileChange::ChangeType change) {
112 Update(file_path, FileChange::Change(change, file_type)); 112 Update(file_path, FileChange::Change(change, file_type));
113 } 113 }
114 114
115 void FileChange::Update(const base::FilePath file_path, 115 void FileChange::Update(const base::FilePath file_path,
116 const ResourceEntry& entry, 116 const ResourceEntry& entry,
117 FileChange::ChangeType change) { 117 FileChange::ChangeType change) {
118 FileType type = !entry.has_file_info() 118 FileType type =
119 ? FILE_TYPE_UNKNOWN 119 entry.deleted() ? FILE_TYPE_UNKNOWN : entry.file_info().is_directory()
120 : entry.file_info().is_directory() ? FILE_TYPE_DIRECTORY 120 ? FILE_TYPE_DIRECTORY
121 : FILE_TYPE_FILE; 121 : FILE_TYPE_FILE;
122
123 Update(file_path, type, change); 122 Update(file_path, type, change);
124 } 123 }
125 124
126 void FileChange::Apply(const FileChange& new_changed_files) { 125 void FileChange::Apply(const FileChange& new_changed_files) {
127 for (Map::const_iterator it = new_changed_files.map().begin(); 126 for (Map::const_iterator it = new_changed_files.map().begin();
128 it != new_changed_files.map().end(); 127 it != new_changed_files.map().end();
129 it++) { 128 it++) {
130 Update(it->first, it->second); 129 Update(it->first, it->second);
131 } 130 }
132 } 131 }
(...skipping 12 matching lines...) Expand all
145 ss << "{ "; 144 ss << "{ ";
146 for (FileChange::Map::const_iterator it = map_.begin(); it != map_.end(); 145 for (FileChange::Map::const_iterator it = map_.begin(); it != map_.end();
147 it++) { 146 it++) {
148 ss << it->first.value() << ": " << it->second.DebugString() << ", "; 147 ss << it->first.value() << ": " << it->second.DebugString() << ", ";
149 } 148 }
150 ss << "}"; 149 ss << "}";
151 return ss.str(); 150 return ss.str();
152 } 151 }
153 152
154 } // namespace drive 153 } // namespace drive
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_manager/event_router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698