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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
326 if (last_url_.is_valid()) { | 326 if (last_url_.is_valid()) { |
327 std::vector<std::string> hosts; | 327 std::vector<std::string> hosts; |
328 hosts.push_back(last_url_.host()); | 328 hosts.push_back(last_url_.host()); |
329 managed_user_service_->SetManualBehaviorForHosts( | 329 managed_user_service_->SetManualBehaviorForHosts( |
330 hosts, ManagedUserService::MANUAL_ALLOW); | 330 hosts, ManagedUserService::MANUAL_ALLOW); |
331 } | 331 } |
332 ClearObserverState(); | 332 ClearObserverState(); |
333 } | 333 } |
334 | 334 |
335 bool ManagedModeNavigationObserver::is_elevated() const { | 335 bool ManagedModeNavigationObserver::is_elevated() const { |
336 #if defined(OS_CHROMEOS) | |
337 return false; | |
338 #else | |
336 return is_elevated_; | 339 return is_elevated_; |
340 #endif | |
337 } | 341 } |
338 | 342 |
339 void ManagedModeNavigationObserver::set_elevated(bool is_elevated) { | 343 void ManagedModeNavigationObserver::set_elevated(bool is_elevated) { |
344 #if !defined(OS_CHROMEOS) | |
340 is_elevated_ = is_elevated; | 345 is_elevated_ = is_elevated; |
Bernhard Bauer
2013/04/11 13:31:18
Hmm, could we DCHECK in that case?
Adrian Kuegel
2013/04/11 15:56:10
Yes, that should work. But it implies I need to ch
| |
346 #endif | |
341 } | 347 } |
342 | 348 |
343 void ManagedModeNavigationObserver::AddURLToPatternList(const GURL& url) { | 349 void ManagedModeNavigationObserver::AddURLToPatternList(const GURL& url) { |
344 navigated_urls_.insert(url); | 350 navigated_urls_.insert(url); |
345 last_url_ = url; | 351 last_url_ = url; |
346 } | 352 } |
347 | 353 |
348 void ManagedModeNavigationObserver::SetStateToRecordingAfterPreview() { | 354 void ManagedModeNavigationObserver::SetStateToRecordingAfterPreview() { |
349 state_ = RECORDING_URLS_AFTER_PREVIEW; | 355 state_ = RECORDING_URLS_AFTER_PREVIEW; |
350 } | 356 } |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
518 | 524 |
519 if (behavior == ManagedModeURLFilter::BLOCK) { | 525 if (behavior == ManagedModeURLFilter::BLOCK) { |
520 DCHECK_EQ(RECORDING_URLS_AFTER_PREVIEW, state_); | 526 DCHECK_EQ(RECORDING_URLS_AFTER_PREVIEW, state_); |
521 // Add the infobar. | 527 // Add the infobar. |
522 if (!preview_infobar_delegate_) { | 528 if (!preview_infobar_delegate_) { |
523 preview_infobar_delegate_ = ManagedModePreviewInfobarDelegate::Create( | 529 preview_infobar_delegate_ = ManagedModePreviewInfobarDelegate::Create( |
524 InfoBarService::FromWebContents(web_contents())); | 530 InfoBarService::FromWebContents(web_contents())); |
525 } | 531 } |
526 } | 532 } |
527 } | 533 } |
OLD | NEW |