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) |
| 345 NOTREACHED(); |
| 346 #else |
340 is_elevated_ = is_elevated; | 347 is_elevated_ = is_elevated; |
| 348 #endif |
341 } | 349 } |
342 | 350 |
343 void ManagedModeNavigationObserver::AddURLToPatternList(const GURL& url) { | 351 void ManagedModeNavigationObserver::AddURLToPatternList(const GURL& url) { |
344 navigated_urls_.insert(url); | 352 navigated_urls_.insert(url); |
345 last_url_ = url; | 353 last_url_ = url; |
346 } | 354 } |
347 | 355 |
348 void ManagedModeNavigationObserver::SetStateToRecordingAfterPreview() { | 356 void ManagedModeNavigationObserver::SetStateToRecordingAfterPreview() { |
349 state_ = RECORDING_URLS_AFTER_PREVIEW; | 357 state_ = RECORDING_URLS_AFTER_PREVIEW; |
350 } | 358 } |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 | 526 |
519 if (behavior == ManagedModeURLFilter::BLOCK) { | 527 if (behavior == ManagedModeURLFilter::BLOCK) { |
520 DCHECK_EQ(RECORDING_URLS_AFTER_PREVIEW, state_); | 528 DCHECK_EQ(RECORDING_URLS_AFTER_PREVIEW, state_); |
521 // Add the infobar. | 529 // Add the infobar. |
522 if (!preview_infobar_delegate_) { | 530 if (!preview_infobar_delegate_) { |
523 preview_infobar_delegate_ = ManagedModePreviewInfobarDelegate::Create( | 531 preview_infobar_delegate_ = ManagedModePreviewInfobarDelegate::Create( |
524 InfoBarService::FromWebContents(web_contents())); | 532 InfoBarService::FromWebContents(web_contents())); |
525 } | 533 } |
526 } | 534 } |
527 } | 535 } |
OLD | NEW |