Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Side by Side Diff: chrome/browser/ui/webui/uber/uber_ui.cc

Issue 10375021: Move Extension into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Take 6 Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options2/search_engine_manager_handler2.cc ('k') | chrome/browser/web_applications/web_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698