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/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 #include "content/public/common/renderer_preferences.h" | 178 #include "content/public/common/renderer_preferences.h" |
179 #include "grit/chromium_strings.h" | 179 #include "grit/chromium_strings.h" |
180 #include "grit/generated_resources.h" | 180 #include "grit/generated_resources.h" |
181 #include "grit/locale_settings.h" | 181 #include "grit/locale_settings.h" |
182 #include "grit/theme_resources.h" | 182 #include "grit/theme_resources.h" |
183 #include "net/base/net_util.h" | 183 #include "net/base/net_util.h" |
184 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 184 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
185 #include "net/cookies/cookie_monster.h" | 185 #include "net/cookies/cookie_monster.h" |
186 #include "net/url_request/url_request_context.h" | 186 #include "net/url_request/url_request_context.h" |
187 #include "ui/base/animation/animation.h" | 187 #include "ui/base/animation/animation.h" |
| 188 #include "ui/base/dialogs/selected_file_info.h" |
188 #include "ui/base/l10n/l10n_util.h" | 189 #include "ui/base/l10n/l10n_util.h" |
189 #include "ui/gfx/point.h" | 190 #include "ui/gfx/point.h" |
190 #include "webkit/glue/web_intent_data.h" | 191 #include "webkit/glue/web_intent_data.h" |
191 #include "webkit/glue/web_intent_service_data.h" | 192 #include "webkit/glue/web_intent_service_data.h" |
192 #include "webkit/glue/webkit_glue.h" | 193 #include "webkit/glue/webkit_glue.h" |
193 #include "webkit/glue/window_open_disposition.h" | 194 #include "webkit/glue/window_open_disposition.h" |
194 #include "webkit/plugins/webplugininfo.h" | 195 #include "webkit/plugins/webplugininfo.h" |
195 | 196 |
196 #if defined(OS_WIN) | 197 #if defined(OS_WIN) |
197 #include "base/win/metro.h" | 198 #include "base/win/metro.h" |
(...skipping 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1732 // Only show the zoom bubble for zoom changes in the active window. | 1733 // Only show the zoom bubble for zoom changes in the active window. |
1733 if (can_show_bubble && window_->IsActive()) | 1734 if (can_show_bubble && window_->IsActive()) |
1734 window_->ShowZoomBubble(zoom_percent); | 1735 window_->ShowZoomBubble(zoom_percent); |
1735 } | 1736 } |
1736 } | 1737 } |
1737 | 1738 |
1738 /////////////////////////////////////////////////////////////////////////////// | 1739 /////////////////////////////////////////////////////////////////////////////// |
1739 // Browser, SelectFileDialog::Listener implementation: | 1740 // Browser, SelectFileDialog::Listener implementation: |
1740 | 1741 |
1741 void Browser::FileSelected(const FilePath& path, int index, void* params) { | 1742 void Browser::FileSelected(const FilePath& path, int index, void* params) { |
1742 profile_->set_last_selected_directory(path.DirName()); | 1743 FileSelectedWithExtraInfo(ui::SelectedFileInfo(path, path), index, params); |
| 1744 } |
| 1745 |
| 1746 void Browser::FileSelectedWithExtraInfo( |
| 1747 const ui::SelectedFileInfo& file_info, |
| 1748 int index, |
| 1749 void* params) { |
| 1750 profile_->set_last_selected_directory(file_info.file_path.DirName()); |
| 1751 |
| 1752 const FilePath& path = file_info.local_path; |
1743 GURL file_url = net::FilePathToFileURL(path); | 1753 GURL file_url = net::FilePathToFileURL(path); |
1744 | 1754 |
1745 #if defined(OS_CHROMEOS) | 1755 #if defined(OS_CHROMEOS) |
1746 gdata::util::ModifyGDataFileResourceUrl(profile_, path, &file_url); | 1756 gdata::util::ModifyGDataFileResourceUrl(profile_, path, &file_url); |
1747 #endif | 1757 #endif |
1748 | 1758 |
1749 if (file_url.is_empty()) | 1759 if (file_url.is_empty()) |
1750 return; | 1760 return; |
1751 | 1761 |
1752 OpenURL(OpenURLParams( | 1762 OpenURL(OpenURLParams( |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2261 if (contents && !allow_js_access) { | 2271 if (contents && !allow_js_access) { |
2262 contents->web_contents()->GetController().LoadURL( | 2272 contents->web_contents()->GetController().LoadURL( |
2263 target_url, | 2273 target_url, |
2264 content::Referrer(), | 2274 content::Referrer(), |
2265 content::PAGE_TRANSITION_LINK, | 2275 content::PAGE_TRANSITION_LINK, |
2266 std::string()); // No extra headers. | 2276 std::string()); // No extra headers. |
2267 } | 2277 } |
2268 | 2278 |
2269 return contents != NULL; | 2279 return contents != NULL; |
2270 } | 2280 } |
OLD | NEW |