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

Side by Side Diff: chrome/browser/chromeos/extensions/file_handler_util.cc

Issue 10702029: Move tab functions off Browser into browser_tabstrip and browser_tabrestore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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
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/extensions/file_handler_util.h" 5 #include "chrome/browser/chromeos/extensions/file_handler_util.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/i18n/case_conversion.h" 9 #include "base/i18n/case_conversion.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "base/stringprintf.h" 12 #include "base/stringprintf.h"
13 #include "base/utf_string_conversions.h" 13 #include "base/utf_string_conversions.h"
14 #include "chrome/browser/chromeos/gdata/gdata_util.h" 14 #include "chrome/browser/chromeos/gdata/gdata_util.h"
15 #include "chrome/browser/chromeos/extensions/file_manager_util.h" 15 #include "chrome/browser/chromeos/extensions/file_manager_util.h"
16 #include "chrome/browser/chromeos/gdata/drive_task_executor.h" 16 #include "chrome/browser/chromeos/gdata/drive_task_executor.h"
17 #include "chrome/browser/extensions/extension_event_router.h" 17 #include "chrome/browser/extensions/extension_event_router.h"
18 #include "chrome/browser/extensions/extension_host.h" 18 #include "chrome/browser/extensions/extension_host.h"
19 #include "chrome/browser/extensions/extension_service.h" 19 #include "chrome/browser/extensions/extension_service.h"
20 #include "chrome/browser/extensions/extension_system.h" 20 #include "chrome/browser/extensions/extension_system.h"
21 #include "chrome/browser/extensions/extension_tab_util.h" 21 #include "chrome/browser/extensions/extension_tab_util.h"
22 #include "chrome/browser/extensions/lazy_background_task_queue.h" 22 #include "chrome/browser/extensions/lazy_background_task_queue.h"
23 #include "chrome/browser/prefs/scoped_user_pref_update.h" 23 #include "chrome/browser/prefs/scoped_user_pref_update.h"
24 #include "chrome/browser/profiles/profile.h" 24 #include "chrome/browser/profiles/profile.h"
25 #include "chrome/browser/profiles/profile_manager.h" 25 #include "chrome/browser/profiles/profile_manager.h"
26 #include "chrome/browser/ui/browser.h" 26 #include "chrome/browser/ui/browser.h"
27 #include "chrome/browser/ui/browser_finder.h" 27 #include "chrome/browser/ui/browser_finder.h"
28 #include "chrome/browser/ui/browser_tabstrip.h"
28 #include "chrome/common/extensions/file_browser_handler.h" 29 #include "chrome/common/extensions/file_browser_handler.h"
29 #include "chrome/common/pref_names.h" 30 #include "chrome/common/pref_names.h"
30 #include "content/public/browser/browser_thread.h" 31 #include "content/public/browser/browser_thread.h"
31 #include "content/public/browser/child_process_security_policy.h" 32 #include "content/public/browser/child_process_security_policy.h"
32 #include "content/public/browser/render_process_host.h" 33 #include "content/public/browser/render_process_host.h"
33 #include "content/public/browser/site_instance.h" 34 #include "content/public/browser/site_instance.h"
34 #include "content/public/browser/web_contents.h" 35 #include "content/public/browser/web_contents.h"
35 #include "net/base/escape.h" 36 #include "net/base/escape.h"
36 #include "webkit/fileapi/file_system_context.h" 37 #include "webkit/fileapi/file_system_context.h"
37 #include "webkit/fileapi/file_system_mount_point_provider.h" 38 #include "webkit/fileapi/file_system_mount_point_provider.h"
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 file_def->SetString("fileSystemRoot", file_system_root.spec()); 823 file_def->SetString("fileSystemRoot", file_system_root.spec());
823 FilePath root(FILE_PATH_LITERAL("/")); 824 FilePath root(FILE_PATH_LITERAL("/"));
824 FilePath full_path = root.Append(iter->virtual_path); 825 FilePath full_path = root.Append(iter->virtual_path);
825 file_def->SetString("fileFullPath", full_path.value()); 826 file_def->SetString("fileFullPath", full_path.value());
826 file_def->SetBoolean("fileIsDirectory", iter->is_directory); 827 file_def->SetBoolean("fileIsDirectory", iter->is_directory);
827 } 828 }
828 829
829 // Get tab id. 830 // Get tab id.
830 Browser* current_browser = GetBrowser(); 831 Browser* current_browser = GetBrowser();
831 if (current_browser) { 832 if (current_browser) {
832 WebContents* contents = current_browser->GetActiveWebContents(); 833 WebContents* contents = chrome::GetActiveWebContents(current_browser);
833 if (contents) 834 if (contents)
834 details->SetInteger("tab_id", ExtensionTabUtil::GetTabId(contents)); 835 details->SetInteger("tab_id", ExtensionTabUtil::GetTabId(contents));
835 } 836 }
836 837
837 std::string json_args; 838 std::string json_args;
838 base::JSONWriter::Write(event_args.get(), &json_args); 839 base::JSONWriter::Write(event_args.get(), &json_args);
839 event_router->DispatchEventToExtension( 840 event_router->DispatchEventToExtension(
840 extension_id_, std::string("fileBrowserHandler.onExecute"), 841 extension_id_, std::string("fileBrowserHandler.onExecute"),
841 json_args, profile(), GURL()); 842 json_args, profile(), GURL());
842 ExecuteDoneOnUIThread(true); 843 ExecuteDoneOnUIThread(true);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 handler_host_permissions_[i].first, 885 handler_host_permissions_[i].first,
885 handler_host_permissions_[i].second); 886 handler_host_permissions_[i].second);
886 } 887 }
887 888
888 // We don't need this anymore. 889 // We don't need this anymore.
889 handler_host_permissions_.clear(); 890 handler_host_permissions_.clear();
890 } 891 }
891 892
892 } // namespace file_handler_util 893 } // namespace file_handler_util
893 894
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698