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

Side by Side Diff: chrome/browser/ui/website_settings/permission_bubble_manager.cc

Issue 162713003: [WebsiteSettings] Set view to null on manager to ensure no stale access. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Set view delegate null on mgr destroy Created 6 years, 10 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 | Annotate | Revision Log
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 "chrome/browser/ui/website_settings/permission_bubble_manager.h" 5 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/ui/website_settings/permission_bubble_request.h" 8 #include "chrome/browser/ui/website_settings/permission_bubble_request.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 : content::WebContentsObserver(web_contents), 83 : content::WebContentsObserver(web_contents),
84 bubble_showing_(false), 84 bubble_showing_(false),
85 view_(NULL), 85 view_(NULL),
86 customization_mode_(false) { 86 customization_mode_(false) {
87 timer_.reset(new base::Timer(FROM_HERE, 87 timer_.reset(new base::Timer(FROM_HERE,
88 base::TimeDelta::FromMilliseconds(kPermissionsCoalesceIntervalMs), 88 base::TimeDelta::FromMilliseconds(kPermissionsCoalesceIntervalMs),
89 base::Bind(&PermissionBubbleManager::ShowBubble, base::Unretained(this)), 89 base::Bind(&PermissionBubbleManager::ShowBubble, base::Unretained(this)),
90 false)); 90 false));
91 } 91 }
92 92
93 PermissionBubbleManager::~PermissionBubbleManager() {} 93 PermissionBubbleManager::~PermissionBubbleManager() {
94 if (view_ != NULL) {
95 view_->SetDelegate(NULL);
96 view_->Hide();
97 bubble_showing_ = false;
98 }
99 }
94 100
95 void PermissionBubbleManager::DidFinishLoad( 101 void PermissionBubbleManager::DidFinishLoad(
96 int64 frame_id, 102 int64 frame_id,
97 const GURL& validated_url, 103 const GURL& validated_url,
98 bool is_main_frame, 104 bool is_main_frame,
99 content::RenderViewHost* render_view_host) { 105 content::RenderViewHost* render_view_host) {
100 // Allows extra time for additional requests to coalesce. 106 // Allows extra time for additional requests to coalesce.
101 if (timer_->IsRunning()) 107 if (timer_->IsRunning())
102 timer_->Reset(); 108 timer_->Reset();
103 } 109 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 timer_->Reset(); 198 timer_->Reset();
193 } 199 }
194 } 200 }
195 201
196 void PermissionBubbleManager::SetCoalesceIntervalForTesting(int interval_ms) { 202 void PermissionBubbleManager::SetCoalesceIntervalForTesting(int interval_ms) {
197 timer_.reset(new base::Timer(FROM_HERE, 203 timer_.reset(new base::Timer(FROM_HERE,
198 base::TimeDelta::FromMilliseconds(interval_ms), 204 base::TimeDelta::FromMilliseconds(interval_ms),
199 base::Bind(&PermissionBubbleManager::ShowBubble, base::Unretained(this)), 205 base::Bind(&PermissionBubbleManager::ShowBubble, base::Unretained(this)),
200 false)); 206 false));
201 } 207 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698