| 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/extensions/api/bookmarks/bookmarks_api.h" | 5 #include "chrome/browser/extensions/api/bookmarks/bookmarks_api.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/i18n/file_util_icu.h" | 9 #include "base/i18n/file_util_icu.h" |
| 10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
| (...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 this, new ChromeSelectFilePolicy(web_contents)); | 942 this, new ChromeSelectFilePolicy(web_contents)); |
| 943 ui::SelectFileDialog::FileTypeInfo file_type_info; | 943 ui::SelectFileDialog::FileTypeInfo file_type_info; |
| 944 file_type_info.extensions.resize(1); | 944 file_type_info.extensions.resize(1); |
| 945 file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("html")); | 945 file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("html")); |
| 946 gfx::NativeWindow owning_window = web_contents ? | 946 gfx::NativeWindow owning_window = web_contents ? |
| 947 platform_util::GetTopLevel(web_contents->GetView()->GetNativeView()) | 947 platform_util::GetTopLevel(web_contents->GetView()->GetNativeView()) |
| 948 : NULL; | 948 : NULL; |
| 949 #if defined(OS_WIN) && defined(USE_AURA) | 949 #if defined(OS_WIN) && defined(USE_AURA) |
| 950 if (!owning_window && | 950 if (!owning_window && |
| 951 chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH) | 951 chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH) |
| 952 owning_window = aura::RemoteRootWindowHostWin::Instance()->GetAshWindow(); | 952 owning_window = aura::RemoteWindowTreeHostWin::Instance()->GetAshWindow(); |
| 953 #endif | 953 #endif |
| 954 // |web_contents| can be NULL (for background pages), which is fine. In such | 954 // |web_contents| can be NULL (for background pages), which is fine. In such |
| 955 // a case if file-selection dialogs are forbidden by policy, we will not | 955 // a case if file-selection dialogs are forbidden by policy, we will not |
| 956 // show an InfoBar, which is better than letting one appear out of the blue. | 956 // show an InfoBar, which is better than letting one appear out of the blue. |
| 957 select_file_dialog_->SelectFile(type, | 957 select_file_dialog_->SelectFile(type, |
| 958 base::string16(), | 958 base::string16(), |
| 959 default_path, | 959 default_path, |
| 960 &file_type_info, | 960 &file_type_info, |
| 961 0, | 961 0, |
| 962 base::FilePath::StringType(), | 962 base::FilePath::StringType(), |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 #if !defined(OS_ANDROID) | 1015 #if !defined(OS_ANDROID) |
| 1016 // Android does not have support for the standard exporter. | 1016 // Android does not have support for the standard exporter. |
| 1017 // TODO(jgreenwald): remove ifdef once extensions are no longer built on | 1017 // TODO(jgreenwald): remove ifdef once extensions are no longer built on |
| 1018 // Android. | 1018 // Android. |
| 1019 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); | 1019 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); |
| 1020 #endif | 1020 #endif |
| 1021 Release(); // Balanced in BookmarksIOFunction::SelectFile() | 1021 Release(); // Balanced in BookmarksIOFunction::SelectFile() |
| 1022 } | 1022 } |
| 1023 | 1023 |
| 1024 } // namespace extensions | 1024 } // namespace extensions |
| OLD | NEW |