| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "chrome/common/render_messages.h" | 25 #include "chrome/common/render_messages.h" |
| 26 #include "content/public/browser/navigation_controller.h" | 26 #include "content/public/browser/navigation_controller.h" |
| 27 #include "content/public/browser/render_view_host.h" | 27 #include "content/public/browser/render_view_host.h" |
| 28 #include "content/public/browser/web_contents.h" | 28 #include "content/public/browser/web_contents.h" |
| 29 #include "content/public/common/page_zoom.h" | 29 #include "content/public/common/page_zoom.h" |
| 30 #include "ui/base/keycodes/keyboard_codes.h" | 30 #include "ui/base/keycodes/keyboard_codes.h" |
| 31 #include "ui/views/focus/accelerator_handler.h" | 31 #include "ui/views/focus/accelerator_handler.h" |
| 32 #include "ui/views/widget/root_view.h" | 32 #include "ui/views/widget/root_view.h" |
| 33 | 33 |
| 34 using content::NavigationController; | 34 using content::NavigationController; |
| 35 using content::RenderViewHost; |
| 35 using content::WebContents; | 36 using content::WebContents; |
| 36 | 37 |
| 37 namespace { | 38 namespace { |
| 38 | 39 |
| 39 // This callback just adds another callback to the event queue. This is useful | 40 // This callback just adds another callback to the event queue. This is useful |
| 40 // if you want to ensure that any callbacks added to the event queue after this | 41 // if you want to ensure that any callbacks added to the event queue after this |
| 41 // one have already been processed by the time |callback| is run. | 42 // one have already been processed by the time |callback| is run. |
| 42 void InvokeCallbackLater(const base::Closure& callback) { | 43 void InvokeCallbackLater(const base::Closure& callback) { |
| 43 MessageLoop::current()->PostTask(FROM_HERE, callback); | 44 MessageLoop::current()->PostTask(FROM_HERE, callback); |
| 44 } | 45 } |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { | 403 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { |
| 403 if (tab_tracker_->ContainsHandle(handle)) { | 404 if (tab_tracker_->ContainsHandle(handle)) { |
| 404 NavigationController* tab = tab_tracker_->GetResource(handle); | 405 NavigationController* tab = tab_tracker_->GetResource(handle); |
| 405 if (tab->GetWebContents() && tab->GetWebContents()->GetRenderViewHost()) { | 406 if (tab->GetWebContents() && tab->GetWebContents()->GetRenderViewHost()) { |
| 406 RenderViewHost* host = tab->GetWebContents()->GetRenderViewHost(); | 407 RenderViewHost* host = tab->GetWebContents()->GetRenderViewHost(); |
| 407 content::PageZoom zoom = static_cast<content::PageZoom>(zoom_level); | 408 content::PageZoom zoom = static_cast<content::PageZoom>(zoom_level); |
| 408 host->Zoom(zoom); | 409 host->Zoom(zoom); |
| 409 } | 410 } |
| 410 } | 411 } |
| 411 } | 412 } |
| OLD | NEW |