OLD | NEW |
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/extensions/file_browser_event_router.h" | 5 #include "chrome/browser/chromeos/extensions/file_browser_event_router.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 void FileBrowserEventRouter::DispatchFolderChangeEvent( | 422 void FileBrowserEventRouter::DispatchFolderChangeEvent( |
423 const FilePath& virtual_path, bool got_error, | 423 const FilePath& virtual_path, bool got_error, |
424 const FileBrowserEventRouter::ExtensionUsageRegistry& extensions) { | 424 const FileBrowserEventRouter::ExtensionUsageRegistry& extensions) { |
425 if (!profile_) { | 425 if (!profile_) { |
426 NOTREACHED(); | 426 NOTREACHED(); |
427 return; | 427 return; |
428 } | 428 } |
429 | 429 |
430 for (ExtensionUsageRegistry::const_iterator iter = extensions.begin(); | 430 for (ExtensionUsageRegistry::const_iterator iter = extensions.begin(); |
431 iter != extensions.end(); ++iter) { | 431 iter != extensions.end(); ++iter) { |
432 GURL target_origin_url(Extension::GetBaseURLFromExtensionId( | 432 GURL target_origin_url(extensions::Extension::GetBaseURLFromExtensionId( |
433 iter->first)); | 433 iter->first)); |
434 GURL base_url = fileapi::GetFileSystemRootURI(target_origin_url, | 434 GURL base_url = fileapi::GetFileSystemRootURI(target_origin_url, |
435 fileapi::kFileSystemTypeExternal); | 435 fileapi::kFileSystemTypeExternal); |
436 GURL target_file_url = GURL(base_url.spec() + virtual_path.value()); | 436 GURL target_file_url = GURL(base_url.spec() + virtual_path.value()); |
437 ListValue args; | 437 ListValue args; |
438 DictionaryValue* watch_info = new DictionaryValue(); | 438 DictionaryValue* watch_info = new DictionaryValue(); |
439 args.Append(watch_info); | 439 args.Append(watch_info); |
440 watch_info->SetString("fileUrl", target_file_url.spec()); | 440 watch_info->SetString("fileUrl", target_file_url.spec()); |
441 watch_info->SetString("eventType", | 441 watch_info->SetString("eventType", |
442 got_error ? kPathWatchError : kPathChanged); | 442 got_error ? kPathWatchError : kPathChanged); |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 return scoped_refptr<RefcountedProfileKeyedService>( | 777 return scoped_refptr<RefcountedProfileKeyedService>( |
778 new FileBrowserEventRouter(profile)); | 778 new FileBrowserEventRouter(profile)); |
779 } | 779 } |
780 | 780 |
781 bool FileBrowserEventRouterFactory::ServiceHasOwnInstanceInIncognito() { | 781 bool FileBrowserEventRouterFactory::ServiceHasOwnInstanceInIncognito() { |
782 // Explicitly and always allow this router in guest login mode. see | 782 // Explicitly and always allow this router in guest login mode. see |
783 // chrome/browser/profiles/profile_keyed_base_factory.h comment | 783 // chrome/browser/profiles/profile_keyed_base_factory.h comment |
784 // for the details. | 784 // for the details. |
785 return true; | 785 return true; |
786 } | 786 } |
OLD | NEW |