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

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

Issue 11516010: Move BookmarkManagerAPI to c/b/e/api (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_ungoop4
Patch Set: Created 8 years 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
« no previous file with comments | « chrome/browser/extensions/extension_web_ui.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "chrome/browser/bookmarks/bookmark_manager_extension_api.h" 13 #include "chrome/browser/extensions/api/bookmark_manager_private/bookmark_manage r_private_api.h"
14 #include "chrome/browser/extensions/extension_service.h" 14 #include "chrome/browser/extensions/extension_service.h"
15 #include "chrome/browser/extensions/extension_tab_util.h" 15 #include "chrome/browser/extensions/extension_tab_util.h"
16 #include "chrome/browser/extensions/image_loader.h" 16 #include "chrome/browser/extensions/image_loader.h"
17 #include "chrome/browser/favicon/favicon_util.h" 17 #include "chrome/browser/favicon/favicon_util.h"
18 #include "chrome/browser/prefs/pref_service.h" 18 #include "chrome/browser/prefs/pref_service.h"
19 #include "chrome/browser/prefs/scoped_user_pref_update.h" 19 #include "chrome/browser/prefs/scoped_user_pref_update.h"
20 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
21 #include "chrome/browser/ui/browser.h" 21 #include "chrome/browser/ui/browser.h"
22 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" 22 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
23 #include "chrome/common/chrome_switches.h" 23 #include "chrome/common/chrome_switches.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 } 165 }
166 } 166 }
167 167
168 if (should_hide_url) 168 if (should_hide_url)
169 web_ui->HideURL(); 169 web_ui->HideURL();
170 170
171 web_ui->SetBindings(bindings); 171 web_ui->SetBindings(bindings);
172 172
173 // Hack: A few things we specialize just for the bookmark manager. 173 // Hack: A few things we specialize just for the bookmark manager.
174 if (extension->id() == extension_misc::kBookmarkManagerId) { 174 if (extension->id() == extension_misc::kBookmarkManagerId) {
175 bookmark_manager_extension_event_router_.reset( 175 bookmark_manager_private_event_router_.reset(
176 new BookmarkManagerExtensionEventRouter(profile, 176 new extensions::BookmarkManagerPrivateEventRouter(
177 web_ui->GetWebContents())); 177 profile, web_ui->GetWebContents()));
178 178
179 web_ui->SetLinkTransitionType(content::PAGE_TRANSITION_AUTO_BOOKMARK); 179 web_ui->SetLinkTransitionType(content::PAGE_TRANSITION_AUTO_BOOKMARK);
180 } 180 }
181 } 181 }
182 182
183 ExtensionWebUI::~ExtensionWebUI() {} 183 ExtensionWebUI::~ExtensionWebUI() {}
184 184
185 BookmarkManagerExtensionEventRouter* 185 extensions::BookmarkManagerPrivateEventRouter*
186 ExtensionWebUI::bookmark_manager_extension_event_router() { 186 ExtensionWebUI::bookmark_manager_private_event_router() {
187 return bookmark_manager_extension_event_router_.get(); 187 return bookmark_manager_private_event_router_.get();
188 } 188 }
189 189
190 //////////////////////////////////////////////////////////////////////////////// 190 ////////////////////////////////////////////////////////////////////////////////
191 // chrome:// URL overrides 191 // chrome:// URL overrides
192 192
193 // static 193 // static
194 void ExtensionWebUI::RegisterUserPrefs(PrefService* prefs) { 194 void ExtensionWebUI::RegisterUserPrefs(PrefService* prefs) {
195 prefs->RegisterDictionaryPref(kExtensionURLOverrides, 195 prefs->RegisterDictionaryPref(kExtensionURLOverrides,
196 PrefService::UNSYNCABLE_PREF); 196 PrefService::UNSYNCABLE_PREF);
197 } 197 }
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 extensions::ImageLoader::ImageRepresentation::ALWAYS_RESIZE, 441 extensions::ImageLoader::ImageRepresentation::ALWAYS_RESIZE,
442 gfx::Size(pixel_size, pixel_size), 442 gfx::Size(pixel_size, pixel_size),
443 scale_factors[i])); 443 scale_factors[i]));
444 } 444 }
445 445
446 // LoadImagesAsync actually can run callback synchronously. We want to force 446 // LoadImagesAsync actually can run callback synchronously. We want to force
447 // async. 447 // async.
448 extensions::ImageLoader::Get(profile)->LoadImagesAsync( 448 extensions::ImageLoader::Get(profile)->LoadImagesAsync(
449 extension, info_list, base::Bind(&RunFaviconCallbackAsync, callback)); 449 extension, info_list, base::Bind(&RunFaviconCallbackAsync, callback));
450 } 450 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_web_ui.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698