| 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/web_view/web_view_guest.h" | 5 #include "extensions/browser/guest_view/web_view/web_view_guest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 double ConvertZoomLevelToZoomFactor(double zoom_level) { | 205 double ConvertZoomLevelToZoomFactor(double zoom_level) { |
| 206 double zoom_factor = content::ZoomLevelToZoomFactor(zoom_level); | 206 double zoom_factor = content::ZoomLevelToZoomFactor(zoom_level); |
| 207 // Because the conversion from zoom level to zoom factor isn't perfect, the | 207 // Because the conversion from zoom level to zoom factor isn't perfect, the |
| 208 // resulting zoom factor is rounded to the nearest 6th decimal place. | 208 // resulting zoom factor is rounded to the nearest 6th decimal place. |
| 209 zoom_factor = round(zoom_factor * 1000000) / 1000000; | 209 zoom_factor = round(zoom_factor * 1000000) / 1000000; |
| 210 return zoom_factor; | 210 return zoom_factor; |
| 211 } | 211 } |
| 212 | 212 |
| 213 using WebViewKey = std::pair<int, int>; | 213 using WebViewKey = std::pair<int, int>; |
| 214 using WebViewKeyToIDMap = std::map<WebViewKey, int>; | 214 using WebViewKeyToIDMap = std::map<WebViewKey, int>; |
| 215 static base::LazyInstance<WebViewKeyToIDMap> web_view_key_to_id_map = | 215 static base::LazyInstance<WebViewKeyToIDMap>::DestructorAtExit |
| 216 LAZY_INSTANCE_INITIALIZER; | 216 web_view_key_to_id_map = LAZY_INSTANCE_INITIALIZER; |
| 217 | 217 |
| 218 } // namespace | 218 } // namespace |
| 219 | 219 |
| 220 // static | 220 // static |
| 221 void WebViewGuest::CleanUp(content::BrowserContext* browser_context, | 221 void WebViewGuest::CleanUp(content::BrowserContext* browser_context, |
| 222 int embedder_process_id, | 222 int embedder_process_id, |
| 223 int view_instance_id) { | 223 int view_instance_id) { |
| 224 GuestViewBase::CleanUp(browser_context, embedder_process_id, | 224 GuestViewBase::CleanUp(browser_context, embedder_process_id, |
| 225 view_instance_id); | 225 view_instance_id); |
| 226 | 226 |
| (...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1558 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 1558 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
| 1559 DispatchEventToView(base::MakeUnique<GuestViewEvent>( | 1559 DispatchEventToView(base::MakeUnique<GuestViewEvent>( |
| 1560 webview::kEventExitFullscreen, std::move(args))); | 1560 webview::kEventExitFullscreen, std::move(args))); |
| 1561 } | 1561 } |
| 1562 // Since we changed fullscreen state, sending a Resize message ensures that | 1562 // Since we changed fullscreen state, sending a Resize message ensures that |
| 1563 // renderer/ sees the change. | 1563 // renderer/ sees the change. |
| 1564 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); | 1564 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); |
| 1565 } | 1565 } |
| 1566 | 1566 |
| 1567 } // namespace extensions | 1567 } // namespace extensions |
| OLD | NEW |