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 "chrome/browser/managed_mode/managed_mode_navigation_observer.h" | 5 #include "chrome/browser/managed_mode/managed_mode_navigation_observer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
263 : WebContentsObserver(web_contents), | 263 : WebContentsObserver(web_contents), |
264 warn_infobar_delegate_(NULL), | 264 warn_infobar_delegate_(NULL), |
265 preview_infobar_delegate_(NULL), | 265 preview_infobar_delegate_(NULL), |
266 state_(RECORDING_URLS_BEFORE_PREVIEW), | 266 state_(RECORDING_URLS_BEFORE_PREVIEW), |
267 is_elevated_(false), | 267 is_elevated_(false), |
268 last_allowed_page_(-1), | 268 last_allowed_page_(-1), |
269 finished_redirects_(false) { | 269 finished_redirects_(false) { |
270 Profile* profile = | 270 Profile* profile = |
271 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 271 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
272 managed_user_service_ = ManagedUserServiceFactory::GetForProfile(profile); | 272 managed_user_service_ = ManagedUserServiceFactory::GetForProfile(profile); |
273 if (!managed_user_service_->ProfileIsManaged()) | 273 if (!managed_user_service_->ProfileIsManaged() || |
274 managed_user_service_->startup_elevation()) { | |
Bernhard Bauer
2013/04/10 09:30:03
I would rather do this when we know that the setti
Adrian Kuegel
2013/04/10 09:47:01
Done.
| |
274 is_elevated_ = true; | 275 is_elevated_ = true; |
276 managed_user_service_->set_startup_elevation(false); | |
277 } | |
275 url_filter_ = managed_user_service_->GetURLFilterForUIThread(); | 278 url_filter_ = managed_user_service_->GetURLFilterForUIThread(); |
276 } | 279 } |
277 | 280 |
278 void ManagedModeNavigationObserver::AddTemporaryException() { | 281 void ManagedModeNavigationObserver::AddTemporaryException() { |
279 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 282 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
280 DCHECK(web_contents()); | 283 DCHECK(web_contents()); |
281 | 284 |
282 BrowserThread::PostTask( | 285 BrowserThread::PostTask( |
283 BrowserThread::IO, | 286 BrowserThread::IO, |
284 FROM_HERE, | 287 FROM_HERE, |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
518 | 521 |
519 if (behavior == ManagedModeURLFilter::BLOCK) { | 522 if (behavior == ManagedModeURLFilter::BLOCK) { |
520 DCHECK_EQ(RECORDING_URLS_AFTER_PREVIEW, state_); | 523 DCHECK_EQ(RECORDING_URLS_AFTER_PREVIEW, state_); |
521 // Add the infobar. | 524 // Add the infobar. |
522 if (!preview_infobar_delegate_) { | 525 if (!preview_infobar_delegate_) { |
523 preview_infobar_delegate_ = ManagedModePreviewInfobarDelegate::Create( | 526 preview_infobar_delegate_ = ManagedModePreviewInfobarDelegate::Create( |
524 InfoBarService::FromWebContents(web_contents())); | 527 InfoBarService::FromWebContents(web_contents())); |
525 } | 528 } |
526 } | 529 } |
527 } | 530 } |
OLD | NEW |