OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/automation/automation_provider.h" | 5 #include "chrome/browser/automation/automation_provider.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "chrome/app/chrome_dll_resource.h" | 8 #include "chrome/app/chrome_dll_resource.h" |
9 #include "chrome/browser/automation/automation_provider_list.h" | 9 #include "chrome/browser/automation/automation_provider_list.h" |
10 #include "chrome/browser/automation/ui_controls.h" | 10 #include "chrome/browser/automation/ui_controls.h" |
(...skipping 1885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1896 } | 1896 } |
1897 | 1897 |
1898 void AutomationProvider::GetDownloadDirectory(const IPC::Message& message, | 1898 void AutomationProvider::GetDownloadDirectory(const IPC::Message& message, |
1899 int handle) { | 1899 int handle) { |
1900 DLOG(INFO) << "Handling download directory request"; | 1900 DLOG(INFO) << "Handling download directory request"; |
1901 std::wstring download_directory; | 1901 std::wstring download_directory; |
1902 if (tab_tracker_->ContainsHandle(handle)) { | 1902 if (tab_tracker_->ContainsHandle(handle)) { |
1903 NavigationController* tab = tab_tracker_->GetResource(handle); | 1903 NavigationController* tab = tab_tracker_->GetResource(handle); |
1904 DownloadManager* dlm = tab->profile()->GetDownloadManager(); | 1904 DownloadManager* dlm = tab->profile()->GetDownloadManager(); |
1905 DCHECK(dlm); | 1905 DCHECK(dlm); |
1906 download_directory = dlm->download_path(); | 1906 download_directory = dlm->download_path().ToWStringHack(); |
1907 } | 1907 } |
1908 | 1908 |
1909 Send(new AutomationMsg_DownloadDirectoryResponse(message.routing_id(), | 1909 Send(new AutomationMsg_DownloadDirectoryResponse(message.routing_id(), |
1910 download_directory)); | 1910 download_directory)); |
1911 } | 1911 } |
1912 | 1912 |
1913 void AutomationProvider::OpenNewBrowserWindow(int show_command) { | 1913 void AutomationProvider::OpenNewBrowserWindow(int show_command) { |
1914 // We may have no current browser windows open so don't rely on | 1914 // We may have no current browser windows open so don't rely on |
1915 // asking an existing browser to execute the IDC_NEWWINDOW command | 1915 // asking an existing browser to execute the IDC_NEWWINDOW command |
1916 Browser* browser = Browser::Create(profile_); | 1916 Browser* browser = Browser::Create(profile_); |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2571 CharacterEncoding::GetCommandIdByCanonicalEncodingName(encoding_name); | 2571 CharacterEncoding::GetCommandIdByCanonicalEncodingName(encoding_name); |
2572 if (selected_encoding_id) { | 2572 if (selected_encoding_id) { |
2573 browser->OverrideEncoding(selected_encoding_id); | 2573 browser->OverrideEncoding(selected_encoding_id); |
2574 succeed = true; | 2574 succeed = true; |
2575 } | 2575 } |
2576 } | 2576 } |
2577 } | 2577 } |
2578 Send(new AutomationMsg_OverrideEncodingResponse(message.routing_id(), | 2578 Send(new AutomationMsg_OverrideEncodingResponse(message.routing_id(), |
2579 succeed)); | 2579 succeed)); |
2580 } | 2580 } |
OLD | NEW |