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 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1902 } | 1902 } |
1903 | 1903 |
1904 void AutomationProvider::GetDownloadDirectory(const IPC::Message& message, | 1904 void AutomationProvider::GetDownloadDirectory(const IPC::Message& message, |
1905 int handle) { | 1905 int handle) { |
1906 DLOG(INFO) << "Handling download directory request"; | 1906 DLOG(INFO) << "Handling download directory request"; |
1907 std::wstring download_directory; | 1907 std::wstring download_directory; |
1908 if (tab_tracker_->ContainsHandle(handle)) { | 1908 if (tab_tracker_->ContainsHandle(handle)) { |
1909 NavigationController* tab = tab_tracker_->GetResource(handle); | 1909 NavigationController* tab = tab_tracker_->GetResource(handle); |
1910 DownloadManager* dlm = tab->profile()->GetDownloadManager(); | 1910 DownloadManager* dlm = tab->profile()->GetDownloadManager(); |
1911 DCHECK(dlm); | 1911 DCHECK(dlm); |
1912 download_directory = dlm->download_path(); | 1912 download_directory = dlm->download_path().ToWStringHack(); |
1913 } | 1913 } |
1914 | 1914 |
1915 Send(new AutomationMsg_DownloadDirectoryResponse(message.routing_id(), | 1915 Send(new AutomationMsg_DownloadDirectoryResponse(message.routing_id(), |
1916 download_directory)); | 1916 download_directory)); |
1917 } | 1917 } |
1918 | 1918 |
1919 void AutomationProvider::OpenNewBrowserWindow(int show_command) { | 1919 void AutomationProvider::OpenNewBrowserWindow(int show_command) { |
1920 // We may have no current browser windows open so don't rely on | 1920 // We may have no current browser windows open so don't rely on |
1921 // asking an existing browser to execute the IDC_NEWWINDOW command | 1921 // asking an existing browser to execute the IDC_NEWWINDOW command |
1922 Browser* browser = Browser::Create(profile_); | 1922 Browser* browser = Browser::Create(profile_); |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2577 CharacterEncoding::GetCommandIdByCanonicalEncodingName(encoding_name); | 2577 CharacterEncoding::GetCommandIdByCanonicalEncodingName(encoding_name); |
2578 if (selected_encoding_id) { | 2578 if (selected_encoding_id) { |
2579 browser->OverrideEncoding(selected_encoding_id); | 2579 browser->OverrideEncoding(selected_encoding_id); |
2580 succeed = true; | 2580 succeed = true; |
2581 } | 2581 } |
2582 } | 2582 } |
2583 } | 2583 } |
2584 Send(new AutomationMsg_OverrideEncodingResponse(message.routing_id(), | 2584 Send(new AutomationMsg_OverrideEncodingResponse(message.routing_id(), |
2585 succeed)); | 2585 succeed)); |
2586 } | 2586 } |
OLD | NEW |