OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues
t.h" | 5 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues
t.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 #include "content/public/browser/render_process_host.h" | 9 #include "content/public/browser/render_process_host.h" |
10 #include "content/public/common/url_constants.h" | 10 #include "content/public/common/url_constants.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 content::Referrer(), | 111 content::Referrer(), |
112 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | 112 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
113 std::string()); | 113 std::string()); |
114 } | 114 } |
115 | 115 |
116 void MimeHandlerViewGuest::DidInitialize() { | 116 void MimeHandlerViewGuest::DidInitialize() { |
117 if (delegate_) | 117 if (delegate_) |
118 delegate_->AttachHelpers(); | 118 delegate_->AttachHelpers(); |
119 } | 119 } |
120 | 120 |
| 121 void MimeHandlerViewGuest::ContentsZoomChange(bool zoom_in) { |
| 122 if (delegate_) |
| 123 delegate_->ChangeZoom(zoom_in); |
| 124 } |
| 125 |
121 void MimeHandlerViewGuest::HandleKeyboardEvent( | 126 void MimeHandlerViewGuest::HandleKeyboardEvent( |
122 WebContents* source, | 127 WebContents* source, |
123 const content::NativeWebKeyboardEvent& event) { | 128 const content::NativeWebKeyboardEvent& event) { |
124 if (!attached()) | 129 if (!attached()) |
125 return; | 130 return; |
126 | 131 |
127 // Send the keyboard events back to the embedder to reprocess them. | 132 // Send the keyboard events back to the embedder to reprocess them. |
128 // TODO(fsamuel): This introduces the possibility of out-of-order keyboard | 133 // TODO(fsamuel): This introduces the possibility of out-of-order keyboard |
129 // events because the guest may be arbitrarily delayed when responding to | 134 // events because the guest may be arbitrarily delayed when responding to |
130 // keyboard events. In that time, the embedder may have received and processed | 135 // keyboard events. In that time, the embedder may have received and processed |
131 // additional key events. This needs to be fixed as soon as possible. | 136 // additional key events. This needs to be fixed as soon as possible. |
132 // See http://crbug.com/229882. | 137 // See http://crbug.com/229882. |
133 embedder_web_contents()->GetDelegate()->HandleKeyboardEvent(web_contents(), | 138 embedder_web_contents()->GetDelegate()->HandleKeyboardEvent(web_contents(), |
134 event); | 139 event); |
135 } | 140 } |
136 | 141 |
137 } // namespace extensions | 142 } // namespace extensions |
OLD | NEW |