| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 private: | 162 private: |
| 163 void Unregister() { | 163 void Unregister() { |
| 164 NotificationService* service = NotificationService::current(); | 164 NotificationService* service = NotificationService::current(); |
| 165 service->RemoveObserver(this, NOTIFY_LOAD_STOP, | 165 service->RemoveObserver(this, NOTIFY_LOAD_STOP, |
| 166 NotificationService::AllSources()); | 166 NotificationService::AllSources()); |
| 167 registered_ = false; | 167 registered_ = false; |
| 168 } | 168 } |
| 169 | 169 |
| 170 bool FinishedRestoring() { | 170 bool FinishedRestoring() { |
| 171 return (!controller_->needs_reload() && !controller_->GetPendingEntry() && | 171 return (!controller_->needs_reload() && !controller_->GetPendingEntry() && |
| 172 !controller_->active_contents()->IsLoading()); | 172 !controller_->active_contents()->is_loading()); |
| 173 } | 173 } |
| 174 | 174 |
| 175 void SendDone() { | 175 void SendDone() { |
| 176 automation_->Send(new AutomationMsg_TabFinishedRestoring(routing_id_)); | 176 automation_->Send(new AutomationMsg_TabFinishedRestoring(routing_id_)); |
| 177 } | 177 } |
| 178 | 178 |
| 179 bool registered_; | 179 bool registered_; |
| 180 AutomationProvider* automation_; | 180 AutomationProvider* automation_; |
| 181 NavigationController* controller_; | 181 NavigationController* controller_; |
| 182 const int routing_id_; | 182 const int routing_id_; |
| (...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1630 count)); | 1630 count)); |
| 1631 } | 1631 } |
| 1632 | 1632 |
| 1633 void AutomationProvider::GetConstrainedWindow(const IPC::Message& message, | 1633 void AutomationProvider::GetConstrainedWindow(const IPC::Message& message, |
| 1634 int handle, int index) { | 1634 int handle, int index) { |
| 1635 int cwindow_handle = 0; | 1635 int cwindow_handle = 0; |
| 1636 if (tab_tracker_->ContainsHandle(handle) && index >= 0) { | 1636 if (tab_tracker_->ContainsHandle(handle) && index >= 0) { |
| 1637 NavigationController* nav_controller = | 1637 NavigationController* nav_controller = |
| 1638 tab_tracker_->GetResource(handle); | 1638 tab_tracker_->GetResource(handle); |
| 1639 TabContents* tab = nav_controller->active_contents(); | 1639 TabContents* tab = nav_controller->active_contents(); |
| 1640 if (tab && index < static_cast<int>(tab->child_windows().size())) { | 1640 if (tab && index < static_cast<int>(tab->child_windows_.size())) { |
| 1641 ConstrainedWindow* window = tab->child_windows()[index]; | 1641 ConstrainedWindow* window = tab->child_windows_[index]; |
| 1642 cwindow_handle = cwindow_tracker_->Add(window); | 1642 cwindow_handle = cwindow_tracker_->Add(window); |
| 1643 } | 1643 } |
| 1644 } | 1644 } |
| 1645 | 1645 |
| 1646 Send(new AutomationMsg_ConstrainedWindowResponse(message.routing_id(), | 1646 Send(new AutomationMsg_ConstrainedWindowResponse(message.routing_id(), |
| 1647 cwindow_handle)); | 1647 cwindow_handle)); |
| 1648 } | 1648 } |
| 1649 | 1649 |
| 1650 void AutomationProvider::GetConstrainedTitle(const IPC::Message& message, | 1650 void AutomationProvider::GetConstrainedTitle(const IPC::Message& message, |
| 1651 int handle) { | 1651 int handle) { |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2398 int value) { | 2398 int value) { |
| 2399 bool success = false; | 2399 bool success = false; |
| 2400 if (browser_tracker_->ContainsHandle(handle)) { | 2400 if (browser_tracker_->ContainsHandle(handle)) { |
| 2401 Browser* browser = browser_tracker_->GetResource(handle); | 2401 Browser* browser = browser_tracker_->GetResource(handle); |
| 2402 browser->profile()->GetPrefs()->SetInteger(name.c_str(), value); | 2402 browser->profile()->GetPrefs()->SetInteger(name.c_str(), value); |
| 2403 success = true; | 2403 success = true; |
| 2404 } | 2404 } |
| 2405 Send(new AutomationMsg_SetIntPreferenceResponse(message.routing_id(), | 2405 Send(new AutomationMsg_SetIntPreferenceResponse(message.routing_id(), |
| 2406 success)); | 2406 success)); |
| 2407 } | 2407 } |
| OLD | NEW |