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