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

Side by Side Diff: chrome/browser/extensions/extension_web_ui.cc

Issue 24891002: Initial WebUI extension for enhanced bookmarks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use build-time flag to enable Created 7 years, 2 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 | Annotate | Revision Log
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/extensions/extension_web_ui.h" 5 #include "chrome/browser/extensions/extension_web_ui.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 kExtensionURLOverrides, 170 kExtensionURLOverrides,
171 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 171 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
172 } 172 }
173 173
174 // static 174 // static
175 bool ExtensionWebUI::HandleChromeURLOverride( 175 bool ExtensionWebUI::HandleChromeURLOverride(
176 GURL* url, content::BrowserContext* browser_context) { 176 GURL* url, content::BrowserContext* browser_context) {
177 if (!url->SchemeIs(chrome::kChromeUIScheme)) 177 if (!url->SchemeIs(chrome::kChromeUIScheme))
178 return false; 178 return false;
179 179
180 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
181 if (!browser_command_line.HasSwitch(switches::kEnableDomDistiller) &&
182 url->host() == chrome::kChromeUIEnhancedBookmarksHost)
Evan Stade 2013/10/01 17:35:26 nit: curlies
Mike Wittman 2013/10/01 17:56:06 I'll remove this change entirely since we don't ne
183 *url = GURL(chrome::kChromeUIBookmarksURL);
184
180 Profile* profile = Profile::FromBrowserContext(browser_context); 185 Profile* profile = Profile::FromBrowserContext(browser_context);
181 const base::DictionaryValue* overrides = 186 const base::DictionaryValue* overrides =
182 profile->GetPrefs()->GetDictionary(kExtensionURLOverrides); 187 profile->GetPrefs()->GetDictionary(kExtensionURLOverrides);
183 std::string page = url->host(); 188 std::string page = url->host();
184 const base::ListValue* url_list = NULL; 189 const base::ListValue* url_list = NULL;
185 if (!overrides || !overrides->GetList(page, &url_list)) 190 if (!overrides || !overrides->GetList(page, &url_list))
186 return false; 191 return false;
187 192
188 ExtensionService* service = profile->GetExtensionService(); 193 ExtensionService* service = profile->GetExtensionService();
189 194
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 extensions::ImageLoader::ImageRepresentation::ALWAYS_RESIZE, 422 extensions::ImageLoader::ImageRepresentation::ALWAYS_RESIZE,
418 gfx::Size(pixel_size, pixel_size), 423 gfx::Size(pixel_size, pixel_size),
419 scale_factors[i])); 424 scale_factors[i]));
420 } 425 }
421 426
422 // LoadImagesAsync actually can run callback synchronously. We want to force 427 // LoadImagesAsync actually can run callback synchronously. We want to force
423 // async. 428 // async.
424 extensions::ImageLoader::Get(profile)->LoadImagesAsync( 429 extensions::ImageLoader::Get(profile)->LoadImagesAsync(
425 extension, info_list, base::Bind(&RunFaviconCallbackAsync, callback)); 430 extension, info_list, base::Bind(&RunFaviconCallbackAsync, callback));
426 } 431 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698