| 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 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1795 *success = false; | 1795 *success = false; |
| 1796 if (browser_tracker_->ContainsHandle(handle)) { | 1796 if (browser_tracker_->ContainsHandle(handle)) { |
| 1797 Browser* browser = browser_tracker_->GetResource(handle); | 1797 Browser* browser = browser_tracker_->GetResource(handle); |
| 1798 browser->profile()->GetPrefs()->SetString(name.c_str(), value); | 1798 browser->profile()->GetPrefs()->SetString(name.c_str(), value); |
| 1799 *success = true; | 1799 *success = true; |
| 1800 } | 1800 } |
| 1801 } | 1801 } |
| 1802 | 1802 |
| 1803 void AutomationProvider::GetBooleanPreference(int handle, | 1803 void AutomationProvider::GetBooleanPreference(int handle, |
| 1804 const std::wstring& name, | 1804 const std::wstring& name, |
| 1805 bool* success, | 1805 bool* value, |
| 1806 bool* value) { | 1806 bool* success) { |
| 1807 *success = false; | 1807 *success = false; |
| 1808 *value = false; | 1808 *value = false; |
| 1809 if (browser_tracker_->ContainsHandle(handle)) { | 1809 if (browser_tracker_->ContainsHandle(handle)) { |
| 1810 Browser* browser = browser_tracker_->GetResource(handle); | 1810 Browser* browser = browser_tracker_->GetResource(handle); |
| 1811 *value = browser->profile()->GetPrefs()->GetBoolean(name.c_str()); | 1811 *value = browser->profile()->GetPrefs()->GetBoolean(name.c_str()); |
| 1812 *success = true; | 1812 *success = true; |
| 1813 } | 1813 } |
| 1814 } | 1814 } |
| 1815 | 1815 |
| 1816 void AutomationProvider::SetBooleanPreference(int handle, | 1816 void AutomationProvider::SetBooleanPreference(int handle, |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2056 for (;iter != BrowserList::end(); ++iter) { | 2056 for (;iter != BrowserList::end(); ++iter) { |
| 2057 gfx::NativeWindow this_window = (*iter)->window()->GetNativeHandle(); | 2057 gfx::NativeWindow this_window = (*iter)->window()->GetNativeHandle(); |
| 2058 if (window == this_window) { | 2058 if (window == this_window) { |
| 2059 // Add() returns the existing handle for the resource if any. | 2059 // Add() returns the existing handle for the resource if any. |
| 2060 *browser_handle = browser_tracker_->Add(*iter); | 2060 *browser_handle = browser_tracker_->Add(*iter); |
| 2061 *success = true; | 2061 *success = true; |
| 2062 return; | 2062 return; |
| 2063 } | 2063 } |
| 2064 } | 2064 } |
| 2065 } | 2065 } |
| OLD | NEW |