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

Side by Side Diff: chrome/browser/extensions/extension_file_browser_private_api.cc

Issue 9015022: Replace most of Browser::GetSelectedTabContents calls into Browser::GetSelectedWebContents. I've ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/extensions/extension_file_browser_private_api.h" 5 #include "chrome/browser/extensions/extension_file_browser_private_api.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 16 matching lines...) Expand all
27 #include "chrome/browser/profiles/profile.h" 27 #include "chrome/browser/profiles/profile.h"
28 #include "chrome/browser/ui/browser.h" 28 #include "chrome/browser/ui/browser.h"
29 #include "chrome/browser/ui/views/select_file_dialog_extension.h" 29 #include "chrome/browser/ui/views/select_file_dialog_extension.h"
30 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" 30 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
31 #include "chrome/common/chrome_switches.h" 31 #include "chrome/common/chrome_switches.h"
32 #include "chrome/common/extensions/extension.h" 32 #include "chrome/common/extensions/extension.h"
33 #include "chrome/common/extensions/file_browser_handler.h" 33 #include "chrome/common/extensions/file_browser_handler.h"
34 #include "chrome/common/pref_names.h" 34 #include "chrome/common/pref_names.h"
35 #include "content/browser/child_process_security_policy.h" 35 #include "content/browser/child_process_security_policy.h"
36 #include "content/browser/renderer_host/render_view_host.h" 36 #include "content/browser/renderer_host/render_view_host.h"
37 #include "content/browser/tab_contents/tab_contents.h" 37 #include "content/browser/site_instance.h"
38 #include "content/public/browser/browser_thread.h" 38 #include "content/public/browser/browser_thread.h"
39 #include "content/public/browser/render_process_host.h" 39 #include "content/public/browser/render_process_host.h"
40 #include "content/public/browser/web_contents.h"
40 #include "googleurl/src/gurl.h" 41 #include "googleurl/src/gurl.h"
41 #include "grit/generated_resources.h" 42 #include "grit/generated_resources.h"
42 #include "grit/platform_locale_settings.h" 43 #include "grit/platform_locale_settings.h"
43 #include "ui/base/l10n/l10n_util.h" 44 #include "ui/base/l10n/l10n_util.h"
44 #include "webkit/fileapi/file_system_context.h" 45 #include "webkit/fileapi/file_system_context.h"
45 #include "webkit/fileapi/file_system_file_util.h" 46 #include "webkit/fileapi/file_system_file_util.h"
46 #include "webkit/fileapi/file_system_mount_point_provider.h" 47 #include "webkit/fileapi/file_system_mount_point_provider.h"
47 #include "webkit/fileapi/file_system_operation.h" 48 #include "webkit/fileapi/file_system_operation.h"
48 #include "webkit/fileapi/file_system_operation_context.h" 49 #include "webkit/fileapi/file_system_operation_context.h"
49 #include "webkit/fileapi/file_system_path_manager.h" 50 #include "webkit/fileapi/file_system_path_manager.h"
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 DictionaryValue* file_def = new DictionaryValue(); 942 DictionaryValue* file_def = new DictionaryValue();
942 files_urls->Append(file_def); 943 files_urls->Append(file_def);
943 file_def->SetString("fileSystemName", file_system_name); 944 file_def->SetString("fileSystemName", file_system_name);
944 file_def->SetString("fileSystemRoot", file_system_root.spec()); 945 file_def->SetString("fileSystemRoot", file_system_root.spec());
945 file_def->SetString("fileFullPath", iter->virtual_path.value()); 946 file_def->SetString("fileFullPath", iter->virtual_path.value());
946 file_def->SetBoolean("fileIsDirectory", iter->is_directory); 947 file_def->SetBoolean("fileIsDirectory", iter->is_directory);
947 } 948 }
948 // Get tab id. 949 // Get tab id.
949 Browser* browser = GetCurrentBrowser(); 950 Browser* browser = GetCurrentBrowser();
950 if (browser) { 951 if (browser) {
951 TabContents* contents = browser->GetSelectedTabContents(); 952 WebContents* contents = browser->GetSelectedWebContents();
952 if (contents) 953 if (contents)
953 details->SetInteger("tab_id", ExtensionTabUtil::GetTabId(contents)); 954 details->SetInteger("tab_id", ExtensionTabUtil::GetTabId(contents));
954 } 955 }
955 956
956 UpdateFileHandlerUsageStats(profile_, task_id); 957 UpdateFileHandlerUsageStats(profile_, task_id);
957 958
958 std::string json_args; 959 std::string json_args;
959 base::JSONWriter::Write(event_args.get(), false, &json_args); 960 base::JSONWriter::Write(event_args.get(), false, &json_args);
960 event_router->DispatchEventToExtension( 961 event_router->DispatchEventToExtension(
961 handler_extension_id, std::string("fileBrowserHandler.onExecute"), 962 handler_extension_id, std::string("fileBrowserHandler.onExecute"),
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
1673 SET_STRING(IDS_FILE_BROWSER, ENQUEUE); 1674 SET_STRING(IDS_FILE_BROWSER, ENQUEUE);
1674 #undef SET_STRING 1675 #undef SET_STRING
1675 1676
1676 ChromeURLDataManager::DataSource::SetFontAndTextDirection(dict); 1677 ChromeURLDataManager::DataSource::SetFontAndTextDirection(dict);
1677 1678
1678 dict->SetString("PLAY_MEDIA", 1679 dict->SetString("PLAY_MEDIA",
1679 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAY)); 1680 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAY));
1680 1681
1681 return true; 1682 return true;
1682 } 1683 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698