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 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1747 // Only show the zoom bubble for zoom changes in the active window. | 1748 // Only show the zoom bubble for zoom changes in the active window. |
1748 if (can_show_bubble && window_->IsActive()) | 1749 if (can_show_bubble && window_->IsActive()) |
1749 window_->ShowZoomBubble(zoom_percent); | 1750 window_->ShowZoomBubble(zoom_percent); |
1750 } | 1751 } |
1751 } | 1752 } |
1752 | 1753 |
1753 /////////////////////////////////////////////////////////////////////////////// | 1754 /////////////////////////////////////////////////////////////////////////////// |
1754 // Browser, SelectFileDialog::Listener implementation: | 1755 // Browser, SelectFileDialog::Listener implementation: |
1755 | 1756 |
1756 void Browser::FileSelected(const FilePath& path, int index, void* params) { | 1757 void Browser::FileSelected(const FilePath& path, int index, void* params) { |
1757 profile_->set_last_selected_directory(path.DirName()); | 1758 FileSelectedWithExtraInfo(ui::SelectedFileInfo(path, path), index, params); |
1759 } | |
1760 | |
1761 void Browser::FileSelectedWithExtraInfo( | |
1762 const ui::SelectedFileInfo& file_info, | |
1763 int index, | |
1764 void* params) { | |
1765 profile_->set_last_selected_directory(file_info.file_path.DirName()); | |
1766 | |
1767 FilePath path = file_info.real_path; | |
achuithb
2012/07/24 20:13:05
nit: const FilePath& would save a copy.
tbarzic
2012/07/25 02:02:54
Done.
| |
1758 GURL file_url = net::FilePathToFileURL(path); | 1768 GURL file_url = net::FilePathToFileURL(path); |
1759 | 1769 |
1760 #if defined(OS_CHROMEOS) | 1770 #if defined(OS_CHROMEOS) |
1761 gdata::util::ModifyGDataFileResourceUrl(profile_, path, &file_url); | 1771 gdata::util::ModifyGDataFileResourceUrl(profile_, path, &file_url); |
1762 #endif | 1772 #endif |
1763 | 1773 |
1764 if (file_url.is_empty()) | 1774 if (file_url.is_empty()) |
1765 return; | 1775 return; |
1766 | 1776 |
1767 OpenURL(OpenURLParams( | 1777 OpenURL(OpenURLParams( |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2276 if (contents && !allow_js_access) { | 2286 if (contents && !allow_js_access) { |
2277 contents->web_contents()->GetController().LoadURL( | 2287 contents->web_contents()->GetController().LoadURL( |
2278 target_url, | 2288 target_url, |
2279 content::Referrer(), | 2289 content::Referrer(), |
2280 content::PAGE_TRANSITION_LINK, | 2290 content::PAGE_TRANSITION_LINK, |
2281 std::string()); // No extra headers. | 2291 std::string()); // No extra headers. |
2282 } | 2292 } |
2283 | 2293 |
2284 return contents != NULL; | 2294 return contents != NULL; |
2285 } | 2295 } |
OLD | NEW |