| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/extensions/extension_view_host.h" | 5 #include "chrome/browser/extensions/extension_view_host.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/strings/string_piece.h" | 8 #include "base/strings/string_piece.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 return; | 201 return; |
| 202 } | 202 } |
| 203 } | 203 } |
| 204 UnhandledKeyboardEvent(source, event); | 204 UnhandledKeyboardEvent(source, event); |
| 205 } | 205 } |
| 206 | 206 |
| 207 bool ExtensionViewHost::PreHandleGestureEvent( | 207 bool ExtensionViewHost::PreHandleGestureEvent( |
| 208 content::WebContents* source, | 208 content::WebContents* source, |
| 209 const blink::WebGestureEvent& event) { | 209 const blink::WebGestureEvent& event) { |
| 210 // Disable pinch zooming. | 210 // Disable pinch zooming. |
| 211 return event.GetType() == blink::WebGestureEvent::kGesturePinchBegin || | 211 return blink::WebInputEvent::IsPinchGestureEventType(event.GetType()); |
| 212 event.GetType() == blink::WebGestureEvent::kGesturePinchUpdate || | |
| 213 event.GetType() == blink::WebGestureEvent::kGesturePinchEnd; | |
| 214 } | 212 } |
| 215 | 213 |
| 216 content::ColorChooser* ExtensionViewHost::OpenColorChooser( | 214 content::ColorChooser* ExtensionViewHost::OpenColorChooser( |
| 217 WebContents* web_contents, | 215 WebContents* web_contents, |
| 218 SkColor initial_color, | 216 SkColor initial_color, |
| 219 const std::vector<content::ColorSuggestion>& suggestions) { | 217 const std::vector<content::ColorSuggestion>& suggestions) { |
| 220 // Similar to the file chooser below, opening a color chooser requires a | 218 // Similar to the file chooser below, opening a color chooser requires a |
| 221 // visible <input> element to click on. Therefore this code only exists for | 219 // visible <input> element to click on. Therefore this code only exists for |
| 222 // extensions with a view. | 220 // extensions with a view. |
| 223 return chrome::ShowColorChooser(web_contents, initial_color); | 221 return chrome::ShowColorChooser(web_contents, initial_color); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 const content::NotificationSource& source, | 301 const content::NotificationSource& source, |
| 304 const content::NotificationDetails& details) { | 302 const content::NotificationDetails& details) { |
| 305 DCHECK_EQ(type, extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY); | 303 DCHECK_EQ(type, extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY); |
| 306 DCHECK(ExtensionSystem::Get(browser_context()) | 304 DCHECK(ExtensionSystem::Get(browser_context()) |
| 307 ->runtime_data() | 305 ->runtime_data() |
| 308 ->IsBackgroundPageReady(extension())); | 306 ->IsBackgroundPageReady(extension())); |
| 309 LoadInitialURL(); | 307 LoadInitialURL(); |
| 310 } | 308 } |
| 311 | 309 |
| 312 } // namespace extensions | 310 } // namespace extensions |
| OLD | NEW |