OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/keyboard_codes.h" | 7 #include "app/keyboard_codes.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 223 |
224 MessageLoop::current()->PostTask(FROM_HERE, new InvokeTaskLaterTask( | 224 MessageLoop::current()->PostTask(FROM_HERE, new InvokeTaskLaterTask( |
225 new WindowDragResponseTask(this, reply_message))); | 225 new WindowDragResponseTask(this, reply_message))); |
226 } else { | 226 } else { |
227 AutomationMsg_WindowDrag::WriteReplyParams(reply_message, false); | 227 AutomationMsg_WindowDrag::WriteReplyParams(reply_message, false); |
228 Send(reply_message); | 228 Send(reply_message); |
229 } | 229 } |
230 } | 230 } |
231 | 231 |
232 void AutomationProvider::CreateExternalTab( | 232 void AutomationProvider::CreateExternalTab( |
233 const IPC::ExternalTabSettings& settings, | 233 const ExternalTabSettings& settings, |
234 gfx::NativeWindow* tab_container_window, gfx::NativeWindow* tab_window, | 234 gfx::NativeWindow* tab_container_window, gfx::NativeWindow* tab_window, |
235 int* tab_handle, int* session_id) { | 235 int* tab_handle, int* session_id) { |
236 TRACE_EVENT_BEGIN("AutomationProvider::CreateExternalTab", 0, ""); | 236 TRACE_EVENT_BEGIN("AutomationProvider::CreateExternalTab", 0, ""); |
237 | 237 |
238 *tab_handle = 0; | 238 *tab_handle = 0; |
239 *tab_container_window = NULL; | 239 *tab_container_window = NULL; |
240 *tab_window = NULL; | 240 *tab_window = NULL; |
241 *session_id = -1; | 241 *session_id = -1; |
242 scoped_refptr<ExternalTabContainer> external_tab_container = | 242 scoped_refptr<ExternalTabContainer> external_tab_container = |
243 new ExternalTabContainer(this, automation_resource_message_filter_); | 243 new ExternalTabContainer(this, automation_resource_message_filter_); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 if (tab_tracker_->ContainsHandle(handle)) { | 311 if (tab_tracker_->ContainsHandle(handle)) { |
312 NavigationController* tab = tab_tracker_->GetResource(handle); | 312 NavigationController* tab = tab_tracker_->GetResource(handle); |
313 return ExternalTabContainer::GetContainerForTab( | 313 return ExternalTabContainer::GetContainerForTab( |
314 tab->tab_contents()->GetNativeView()); | 314 tab->tab_contents()->GetNativeView()); |
315 } | 315 } |
316 | 316 |
317 return NULL; | 317 return NULL; |
318 } | 318 } |
319 | 319 |
320 void AutomationProvider::OnTabReposition( | 320 void AutomationProvider::OnTabReposition( |
321 int tab_handle, const IPC::Reposition_Params& params) { | 321 int tab_handle, const Reposition_Params& params) { |
322 if (!tab_tracker_->ContainsHandle(tab_handle)) | 322 if (!tab_tracker_->ContainsHandle(tab_handle)) |
323 return; | 323 return; |
324 | 324 |
325 if (!IsWindow(params.window)) | 325 if (!IsWindow(params.window)) |
326 return; | 326 return; |
327 | 327 |
328 unsigned long process_id = 0; | 328 unsigned long process_id = 0; |
329 unsigned long thread_id = 0; | 329 unsigned long thread_id = 0; |
330 | 330 |
331 thread_id = GetWindowThreadProcessId(params.window, &process_id); | 331 thread_id = GetWindowThreadProcessId(params.window, &process_id); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 533 |
534 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { | 534 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { |
535 if (tab_tracker_->ContainsHandle(handle)) { | 535 if (tab_tracker_->ContainsHandle(handle)) { |
536 NavigationController* tab = tab_tracker_->GetResource(handle); | 536 NavigationController* tab = tab_tracker_->GetResource(handle); |
537 if (tab->tab_contents() && tab->tab_contents()->render_view_host()) { | 537 if (tab->tab_contents() && tab->tab_contents()->render_view_host()) { |
538 tab->tab_contents()->render_view_host()->Zoom( | 538 tab->tab_contents()->render_view_host()->Zoom( |
539 static_cast<PageZoom::Function>(zoom_level)); | 539 static_cast<PageZoom::Function>(zoom_level)); |
540 } | 540 } |
541 } | 541 } |
542 } | 542 } |
OLD | NEW |