| 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/ui/webui/history_ui.h" | 5 #include "chrome/browser/ui/webui/history_ui.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 std::string device_name; | 362 std::string device_name; |
| 363 std::string device_type; | 363 std::string device_type; |
| 364 if (!client_id.empty()) | 364 if (!client_id.empty()) |
| 365 GetDeviceNameAndType(sync_service, client_id, &device_name, &device_type); | 365 GetDeviceNameAndType(sync_service, client_id, &device_name, &device_type); |
| 366 result->SetString("deviceName", device_name); | 366 result->SetString("deviceName", device_name); |
| 367 result->SetString("deviceType", device_type); | 367 result->SetString("deviceType", device_type); |
| 368 | 368 |
| 369 #if defined(ENABLE_MANAGED_USERS) | 369 #if defined(ENABLE_MANAGED_USERS) |
| 370 DCHECK(managed_user_service); | 370 DCHECK(managed_user_service); |
| 371 if (managed_user_service->ProfileIsManaged()) { | 371 if (managed_user_service->ProfileIsManaged()) { |
| 372 // URL exceptions take precedence over host exceptions. | 372 const ManagedModeURLFilter* url_filter = |
| 373 int manual_behavior = managed_user_service->GetManualBehaviorForURL(url); | 373 managed_user_service->GetURLFilterForUIThread(); |
| 374 if (manual_behavior == ManagedUserService::MANUAL_NONE) { | 374 int filtering_behavior = |
| 375 manual_behavior = | 375 url_filter->GetFilteringBehaviorForURL(url.GetWithEmptyPath()); |
| 376 managed_user_service->GetManualBehaviorForHost(url.host()); | 376 result->SetInteger("hostFilteringBehavior", filtering_behavior); |
| 377 } | |
| 378 result->SetInteger("urlManualBehavior", manual_behavior); | |
| 379 result->SetInteger("hostManualBehavior", | |
| 380 managed_user_service->GetManualBehaviorForHost(url.host())); | |
| 381 std::vector<ManagedModeSiteList::Site*> sites; | |
| 382 managed_user_service->GetURLFilterForUIThread()->GetSites(url, &sites); | |
| 383 result->SetBoolean("urlInContentPack", !sites.empty()); | |
| 384 sites.clear(); | |
| 385 managed_user_service->GetURLFilterForUIThread()->GetSites( | |
| 386 url.GetWithEmptyPath(), &sites); | |
| 387 result->SetBoolean("hostInContentPack", !sites.empty()); | |
| 388 | 377 |
| 389 result->SetBoolean("blockedVisit", blocked_visit); | 378 result->SetBoolean("blockedVisit", blocked_visit); |
| 390 } | 379 } |
| 391 #endif | 380 #endif |
| 392 | 381 |
| 393 return result.Pass(); | 382 return result.Pass(); |
| 394 } | 383 } |
| 395 | 384 |
| 396 bool BrowsingHistoryHandler::HistoryEntry::SortByTimeDescending( | 385 bool BrowsingHistoryHandler::HistoryEntry::SortByTimeDescending( |
| 397 const BrowsingHistoryHandler::HistoryEntry& entry1, | 386 const BrowsingHistoryHandler::HistoryEntry& entry1, |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + | 981 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + |
| 993 net::EscapeQueryParamValue(UTF16ToUTF8(text), true)); | 982 net::EscapeQueryParamValue(UTF16ToUTF8(text), true)); |
| 994 } | 983 } |
| 995 | 984 |
| 996 // static | 985 // static |
| 997 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( | 986 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( |
| 998 ui::ScaleFactor scale_factor) { | 987 ui::ScaleFactor scale_factor) { |
| 999 return ResourceBundle::GetSharedInstance(). | 988 return ResourceBundle::GetSharedInstance(). |
| 1000 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); | 989 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); |
| 1001 } | 990 } |
| OLD | NEW |