Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: extensions/browser/guest_view/web_view/web_view_guest.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/browser/guest_view/guest_view_events.cc ('k') | extensions/common/feature_switch.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « extensions/browser/guest_view/guest_view_events.cc ('k') | extensions/common/feature_switch.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698