OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <set> | 7 #include <set> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/message_box_flags.h" | 10 #include "app/message_box_flags.h" |
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1843 const std::string& encoding_name, | 1843 const std::string& encoding_name, |
1844 bool* success) { | 1844 bool* success) { |
1845 *success = false; | 1845 *success = false; |
1846 #if defined(OS_WIN) | 1846 #if defined(OS_WIN) |
1847 if (tab_tracker_->ContainsHandle(tab_handle)) { | 1847 if (tab_tracker_->ContainsHandle(tab_handle)) { |
1848 NavigationController* nav = tab_tracker_->GetResource(tab_handle); | 1848 NavigationController* nav = tab_tracker_->GetResource(tab_handle); |
1849 Browser* browser = FindAndActivateTab(nav); | 1849 Browser* browser = FindAndActivateTab(nav); |
1850 DCHECK(browser); | 1850 DCHECK(browser); |
1851 | 1851 |
1852 if (browser->command_updater()->IsCommandEnabled(IDC_ENCODING_MENU)) { | 1852 if (browser->command_updater()->IsCommandEnabled(IDC_ENCODING_MENU)) { |
1853 TabContents* tab_contents = nav->tab_contents(); | |
1854 int selected_encoding_id = | 1853 int selected_encoding_id = |
1855 CharacterEncoding::GetCommandIdByCanonicalEncodingName(encoding_name); | 1854 CharacterEncoding::GetCommandIdByCanonicalEncodingName(encoding_name); |
1856 if (selected_encoding_id) { | 1855 if (selected_encoding_id) { |
1857 browser->OverrideEncoding(selected_encoding_id); | 1856 browser->OverrideEncoding(selected_encoding_id); |
1858 *success = true; | 1857 *success = true; |
1859 } | 1858 } |
1860 } | 1859 } |
1861 } | 1860 } |
1862 #else | 1861 #else |
1863 // TODO(port): Enable when encoding-related parts of Browser are ported. | 1862 // TODO(port): Enable when encoding-related parts of Browser are ported. |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2056 for (;iter != BrowserList::end(); ++iter) { | 2055 for (;iter != BrowserList::end(); ++iter) { |
2057 gfx::NativeWindow this_window = (*iter)->window()->GetNativeHandle(); | 2056 gfx::NativeWindow this_window = (*iter)->window()->GetNativeHandle(); |
2058 if (window == this_window) { | 2057 if (window == this_window) { |
2059 // Add() returns the existing handle for the resource if any. | 2058 // Add() returns the existing handle for the resource if any. |
2060 *browser_handle = browser_tracker_->Add(*iter); | 2059 *browser_handle = browser_tracker_->Add(*iter); |
2061 *success = true; | 2060 *success = true; |
2062 return; | 2061 return; |
2063 } | 2062 } |
2064 } | 2063 } |
2065 } | 2064 } |
OLD | NEW |