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 "content/renderer/browser_plugin/browser_plugin_manager.h" | 5 #include "content/renderer/browser_plugin/browser_plugin_manager.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/threading/thread_local.h" | 9 #include "base/threading/thread_local.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 BrowserPlugin* BrowserPluginManager::GetBrowserPlugin( | 48 BrowserPlugin* BrowserPluginManager::GetBrowserPlugin( |
49 int browser_plugin_instance_id) const { | 49 int browser_plugin_instance_id) const { |
50 return instances_.Lookup(browser_plugin_instance_id); | 50 return instances_.Lookup(browser_plugin_instance_id); |
51 } | 51 } |
52 | 52 |
53 int BrowserPluginManager::GetNextInstanceID() { | 53 int BrowserPluginManager::GetNextInstanceID() { |
54 return ++current_instance_id_; | 54 return ++current_instance_id_; |
55 } | 55 } |
56 | 56 |
57 void BrowserPluginManager::UpdateDeviceScaleFactor(float device_scale_factor) { | 57 void BrowserPluginManager::UpdateDeviceScaleFactor() { |
58 IDMap<BrowserPlugin>::iterator iter(&instances_); | 58 IDMap<BrowserPlugin>::iterator iter(&instances_); |
59 while (!iter.IsAtEnd()) { | 59 while (!iter.IsAtEnd()) { |
60 iter.GetCurrentValue()->UpdateDeviceScaleFactor(device_scale_factor); | 60 iter.GetCurrentValue()->UpdateDeviceScaleFactor(); |
61 iter.Advance(); | 61 iter.Advance(); |
62 } | 62 } |
63 } | 63 } |
64 | 64 |
65 void BrowserPluginManager::UpdateFocusState() { | 65 void BrowserPluginManager::UpdateFocusState() { |
66 IDMap<BrowserPlugin>::iterator iter(&instances_); | 66 IDMap<BrowserPlugin>::iterator iter(&instances_); |
67 while (!iter.IsAtEnd()) { | 67 while (!iter.IsAtEnd()) { |
68 iter.GetCurrentValue()->UpdateGuestFocusState(); | 68 iter.GetCurrentValue()->UpdateGuestFocusState(); |
69 iter.Advance(); | 69 iter.Advance(); |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
73 void BrowserPluginManager::Attach(int browser_plugin_instance_id) { | 73 void BrowserPluginManager::Attach(int browser_plugin_instance_id) { |
74 BrowserPlugin* plugin = GetBrowserPlugin(browser_plugin_instance_id); | 74 BrowserPlugin* plugin = GetBrowserPlugin(browser_plugin_instance_id); |
75 if (plugin) | 75 if (plugin) |
76 plugin->Attach(); | 76 plugin->Attach(); |
77 } | 77 } |
78 | 78 |
79 } // namespace content | 79 } // namespace content |
OLD | NEW |