| 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/uber/uber_ui.h" | 5 #include "chrome/browser/ui/webui/uber/uber_ui.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 } | 67 } |
| 68 | 68 |
| 69 // Determines whether the user has an active extension of the given type. | 69 // Determines whether the user has an active extension of the given type. |
| 70 bool HasExtensionType(Profile* profile, const char* extensionType) { | 70 bool HasExtensionType(Profile* profile, const char* extensionType) { |
| 71 const ExtensionSet* extensionSet = | 71 const ExtensionSet* extensionSet = |
| 72 profile->GetExtensionService()->extensions(); | 72 profile->GetExtensionService()->extensions(); |
| 73 | 73 |
| 74 for (ExtensionSet::const_iterator iter = extensionSet->begin(); | 74 for (ExtensionSet::const_iterator iter = extensionSet->begin(); |
| 75 iter != extensionSet->end(); ++iter) { | 75 iter != extensionSet->end(); ++iter) { |
| 76 extensions::URLOverrides::URLOverrideMap map = | 76 extensions::URLOverrides::URLOverrideMap map = |
| 77 extensions::URLOverrides::GetChromeURLOverrides(*iter); | 77 extensions::URLOverrides::GetChromeURLOverrides(iter->get()); |
| 78 extensions::URLOverrides::URLOverrideMap::const_iterator result = | 78 extensions::URLOverrides::URLOverrideMap::const_iterator result = |
| 79 map.find(std::string(extensionType)); | 79 map.find(std::string(extensionType)); |
| 80 | 80 |
| 81 if (result != map.end()) | 81 if (result != map.end()) |
| 82 return true; | 82 return true; |
| 83 } | 83 } |
| 84 | 84 |
| 85 return false; | 85 return false; |
| 86 } | 86 } |
| 87 | 87 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 scoped_ptr<Value> overrideValue( | 217 scoped_ptr<Value> overrideValue( |
| 218 Value::CreateStringValue(overridesHistory ? "yes" : "no")); | 218 Value::CreateStringValue(overridesHistory ? "yes" : "no")); |
| 219 web_ui()->CallJavascriptFunction( | 219 web_ui()->CallJavascriptFunction( |
| 220 "uber_frame.setNavigationOverride", *controlsValue, *overrideValue); | 220 "uber_frame.setNavigationOverride", *controlsValue, *overrideValue); |
| 221 break; | 221 break; |
| 222 } | 222 } |
| 223 default: | 223 default: |
| 224 NOTREACHED(); | 224 NOTREACHED(); |
| 225 } | 225 } |
| 226 } | 226 } |
| OLD | NEW |