| Index: chrome/browser/managed_mode/managed_mode_resource_throttle.cc
|
| diff --git a/chrome/browser/managed_mode/managed_mode_resource_throttle.cc b/chrome/browser/managed_mode/managed_mode_resource_throttle.cc
|
| index 654dca87238706fd85cb246e2bcd03e2ce67ea5b..a429a82797540ad700f0286bc79bfca529114b2a 100644
|
| --- a/chrome/browser/managed_mode/managed_mode_resource_throttle.cc
|
| +++ b/chrome/browser/managed_mode/managed_mode_resource_throttle.cc
|
| @@ -29,19 +29,11 @@ struct WebContentsId {
|
| int render_view_id;
|
| };
|
|
|
| -struct TemporaryExceptionData {
|
| - // Hostname for which the temporary exception was added.
|
| - std::string host;
|
| - // Whether the user initiated a new navigation or not.
|
| - bool new_navigation;
|
| -};
|
| -
|
| // This map contains <render_process_host_id_, render_view_id> pairs mapped
|
| -// to |TemporaryExceptionData| which identifies individual tabs. If a
|
| -// |TemporaryExceptionData| is present for a specific pair then the user
|
| -// clicked preview, is navigating around and has not clicked one of the options
|
| -// on the infobar.
|
| -typedef std::map<WebContentsId, TemporaryExceptionData> PreviewMap;
|
| +// to a host string which identifies individual tabs. If a host is present for
|
| +// a specific pair then the user clicked preview, is navigating around and has
|
| +// not clicked one of the options on the infobar.
|
| +typedef std::map<WebContentsId, std::string> PreviewMap;
|
| base::LazyInstance<PreviewMap> g_in_preview_mode = LAZY_INSTANCE_INITIALIZER;
|
|
|
| }
|
| @@ -66,27 +58,9 @@ ManagedModeResourceThrottle::~ManagedModeResourceThrottle() {}
|
| void ManagedModeResourceThrottle::AddTemporaryException(
|
| int render_process_host_id,
|
| int render_view_id,
|
| - const GURL& url,
|
| - bool new_navigation) {
|
| - TemporaryExceptionData data;
|
| - data.host = url.host();
|
| - data.new_navigation = new_navigation;
|
| - WebContentsId web_contents_id(render_process_host_id, render_view_id);
|
| - g_in_preview_mode.Get()[web_contents_id] = data;
|
| -}
|
| -
|
| -// static
|
| -void ManagedModeResourceThrottle::UpdateExceptionNavigationStatus(
|
| - int render_process_host_id,
|
| - int render_view_id,
|
| - bool new_navigation) {
|
| - PreviewMap* preview_map = g_in_preview_mode.Pointer();
|
| + const GURL& url) {
|
| WebContentsId web_contents_id(render_process_host_id, render_view_id);
|
| - PreviewMap::iterator it = preview_map->find(web_contents_id);
|
| - if (it == preview_map->end())
|
| - return;
|
| -
|
| - it->second.new_navigation = new_navigation;
|
| + g_in_preview_mode.Get()[web_contents_id] = url.host();
|
| }
|
|
|
| // static
|
| @@ -119,8 +93,7 @@ void ManagedModeResourceThrottle::ShowInterstitialIfNeeded(bool is_redirect,
|
|
|
| WebContentsId web_contents_id(render_process_host_id_, render_view_id_);
|
| PreviewMap::iterator it = preview_map->find(web_contents_id);
|
| - if (it != preview_map->end() &&
|
| - (!it->second.new_navigation || url.host() == it->second.host)) {
|
| + if (it != preview_map->end() && url.host() == it->second) {
|
| temporarily_allowed_ = true;
|
| RemoveTemporaryException(render_process_host_id_, render_view_id_);
|
| return;
|
|
|