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_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/file_browser_private_api.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 } | 858 } |
859 | 859 |
860 void ViewFilesFunction::GetLocalPathsResponseOnUIThread( | 860 void ViewFilesFunction::GetLocalPathsResponseOnUIThread( |
861 const std::string& internal_task_id, | 861 const std::string& internal_task_id, |
862 const SelectedFileInfoList& files) { | 862 const SelectedFileInfoList& files) { |
863 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 863 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
864 bool success = true; | 864 bool success = true; |
865 for (SelectedFileInfoList::const_iterator iter = files.begin(); | 865 for (SelectedFileInfoList::const_iterator iter = files.begin(); |
866 iter != files.end(); | 866 iter != files.end(); |
867 ++iter) { | 867 ++iter) { |
868 bool handled = file_manager_util::TryViewingFile(iter->path); | 868 bool handled = file_manager_util::TryViewingFile(profile(), iter->path); |
869 // If there is no default browser-defined handler for viewing this type | 869 // If there is no default browser-defined handler for viewing this type |
870 // of file, try to see if we have any extension installed for it instead. | 870 // of file, try to see if we have any extension installed for it instead. |
871 if (!handled && files.size() == 1) | 871 if (!handled && files.size() == 1) |
872 success = false; | 872 success = false; |
873 } | 873 } |
874 result_.reset(Value::CreateBooleanValue(success)); | 874 result_.reset(Value::CreateBooleanValue(success)); |
875 SendResponse(true); | 875 SendResponse(true); |
876 } | 876 } |
877 | 877 |
878 SelectFilesFunction::SelectFilesFunction() { | 878 SelectFilesFunction::SelectFilesFunction() { |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1487 SET_STRING(IDS_FILE_BROWSER, GDATA_CANNOT_REACH); | 1487 SET_STRING(IDS_FILE_BROWSER, GDATA_CANNOT_REACH); |
1488 SET_STRING(IDS_FILE_BROWSER, GDATA_RETRY); | 1488 SET_STRING(IDS_FILE_BROWSER, GDATA_RETRY); |
1489 | 1489 |
1490 SET_STRING(IDS_FILE_BROWSER, AUDIO_PLAYER_TITLE); | 1490 SET_STRING(IDS_FILE_BROWSER, AUDIO_PLAYER_TITLE); |
1491 #undef SET_STRING | 1491 #undef SET_STRING |
1492 | 1492 |
1493 dict->SetString("GDATA_LEARN_MORE", | 1493 dict->SetString("GDATA_LEARN_MORE", |
1494 l10n_util::GetStringUTF16(IDS_LEARN_MORE)); | 1494 l10n_util::GetStringUTF16(IDS_LEARN_MORE)); |
1495 | 1495 |
1496 dict->SetString("PDF_VIEW_ENABLED", | 1496 dict->SetString("PDF_VIEW_ENABLED", |
1497 file_manager_util::ShouldBeOpenedWithPdfPlugin(".pdf") ? | 1497 file_manager_util::ShouldBeOpenedWithPdfPlugin(profile(), ".pdf") ? |
1498 "true" : "false"); | 1498 "true" : "false"); |
1499 | 1499 |
1500 ChromeURLDataManager::DataSource::SetFontAndTextDirection(dict); | 1500 ChromeURLDataManager::DataSource::SetFontAndTextDirection(dict); |
1501 | 1501 |
1502 if (gdata::util::IsGDataAvailable(profile_)) | 1502 if (gdata::util::IsGDataAvailable(profile())) |
1503 dict->SetString("ENABLE_GDATA", "1"); | 1503 dict->SetString("ENABLE_GDATA", "1"); |
1504 | 1504 |
1505 return true; | 1505 return true; |
1506 } | 1506 } |
1507 | 1507 |
1508 GetGDataFilePropertiesFunction::GetGDataFilePropertiesFunction() { | 1508 GetGDataFilePropertiesFunction::GetGDataFilePropertiesFunction() { |
1509 } | 1509 } |
1510 | 1510 |
1511 GetGDataFilePropertiesFunction::~GetGDataFilePropertiesFunction() { | 1511 GetGDataFilePropertiesFunction::~GetGDataFilePropertiesFunction() { |
1512 } | 1512 } |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1986 if (value->GetBoolean("cellularDisabled", &tmp)) { | 1986 if (value->GetBoolean("cellularDisabled", &tmp)) { |
1987 service->SetBoolean(prefs::kDisableGDataOverCellular, tmp); | 1987 service->SetBoolean(prefs::kDisableGDataOverCellular, tmp); |
1988 } | 1988 } |
1989 | 1989 |
1990 if (value->GetBoolean("hostedFilesDisabled", &tmp)) { | 1990 if (value->GetBoolean("hostedFilesDisabled", &tmp)) { |
1991 service->SetBoolean(prefs::kDisableGDataHostedFiles, tmp); | 1991 service->SetBoolean(prefs::kDisableGDataHostedFiles, tmp); |
1992 } | 1992 } |
1993 | 1993 |
1994 return true; | 1994 return true; |
1995 } | 1995 } |
OLD | NEW |