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 #include "chrome/browser/devtools/devtools_window.h" | 4 #include "chrome/browser/devtools/devtools_window.h" |
5 | 5 |
6 #include <algorithm> | 6 #include <algorithm> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 } | 1051 } |
1052 | 1052 |
1053 void DevToolsWindow::RemoveFileSystem(const std::string& file_system_path) { | 1053 void DevToolsWindow::RemoveFileSystem(const std::string& file_system_path) { |
1054 CHECK(web_contents_->GetURL().SchemeIs(chrome::kChromeDevToolsScheme)); | 1054 CHECK(web_contents_->GetURL().SchemeIs(chrome::kChromeDevToolsScheme)); |
1055 file_helper_->RemoveFileSystem(file_system_path); | 1055 file_helper_->RemoveFileSystem(file_system_path); |
1056 StringValue file_system_path_value(file_system_path); | 1056 StringValue file_system_path_value(file_system_path); |
1057 CallClientFunction("InspectorFrontendAPI.fileSystemRemoved", | 1057 CallClientFunction("InspectorFrontendAPI.fileSystemRemoved", |
1058 &file_system_path_value, NULL, NULL); | 1058 &file_system_path_value, NULL, NULL); |
1059 } | 1059 } |
1060 | 1060 |
| 1061 void DevToolsWindow::UpgradeDraggedFileSystemPermissions( |
| 1062 const std::string& file_system_url) { |
| 1063 CHECK(web_contents_->GetURL().SchemeIs(chrome::kChromeDevToolsScheme)); |
| 1064 file_helper_->UpgradeDraggedFileSystemPermissions( |
| 1065 file_system_url, |
| 1066 base::Bind(&DevToolsWindow::FileSystemAdded, weak_factory_.GetWeakPtr()), |
| 1067 base::Bind(&DevToolsWindow::ShowDevToolsConfirmInfoBar, |
| 1068 weak_factory_.GetWeakPtr())); |
| 1069 } |
| 1070 |
1061 void DevToolsWindow::IndexPath(int request_id, | 1071 void DevToolsWindow::IndexPath(int request_id, |
1062 const std::string& file_system_path) { | 1072 const std::string& file_system_path) { |
1063 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1073 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1064 CHECK(web_contents_->GetURL().SchemeIs(chrome::kChromeDevToolsScheme)); | 1074 CHECK(web_contents_->GetURL().SchemeIs(chrome::kChromeDevToolsScheme)); |
1065 if (!file_helper_->IsFileSystemAdded(file_system_path)) { | 1075 if (!file_helper_->IsFileSystemAdded(file_system_path)) { |
1066 IndexingDone(request_id, file_system_path); | 1076 IndexingDone(request_id, file_system_path); |
1067 return; | 1077 return; |
1068 } | 1078 } |
1069 indexing_jobs_[request_id] = | 1079 indexing_jobs_[request_id] = |
1070 scoped_refptr<DevToolsFileSystemIndexer::FileSystemIndexingJob>( | 1080 scoped_refptr<DevToolsFileSystemIndexer::FileSystemIndexingJob>( |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1406 return inspected_contents_observer_ ? | 1416 return inspected_contents_observer_ ? |
1407 inspected_contents_observer_->web_contents() : NULL; | 1417 inspected_contents_observer_->web_contents() : NULL; |
1408 } | 1418 } |
1409 | 1419 |
1410 void DevToolsWindow::DocumentOnLoadCompletedInMainFrame() { | 1420 void DevToolsWindow::DocumentOnLoadCompletedInMainFrame() { |
1411 is_loaded_ = true; | 1421 is_loaded_ = true; |
1412 UpdateTheme(); | 1422 UpdateTheme(); |
1413 DoAction(); | 1423 DoAction(); |
1414 AddDevToolsExtensionsToClient(); | 1424 AddDevToolsExtensionsToClient(); |
1415 } | 1425 } |
OLD | NEW |