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