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/bookmarks/bookmark_utils.h" | 5 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
6 | 6 |
7 #include "apps/app_launcher.h" | 7 #include "apps/app_launcher.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 } | 243 } |
244 | 244 |
245 void GetURLAndTitleToBookmark(content::WebContents* web_contents, | 245 void GetURLAndTitleToBookmark(content::WebContents* web_contents, |
246 GURL* url, | 246 GURL* url, |
247 string16* title) { | 247 string16* title) { |
248 *url = GetURLToBookmark(web_contents); | 248 *url = GetURLToBookmark(web_contents); |
249 *title = web_contents->GetTitle(); | 249 *title = web_contents->GetTitle(); |
250 } | 250 } |
251 | 251 |
252 void ToggleBookmarkBarWhenVisible(content::BrowserContext* browser_context) { | 252 void ToggleBookmarkBarWhenVisible(content::BrowserContext* browser_context) { |
253 PrefService* prefs = components::UserPrefs::Get(browser_context); | 253 PrefService* prefs = user_prefs::UserPrefs::Get(browser_context); |
254 const bool always_show = !prefs->GetBoolean(prefs::kShowBookmarkBar); | 254 const bool always_show = !prefs->GetBoolean(prefs::kShowBookmarkBar); |
255 | 255 |
256 // The user changed when the bookmark bar is shown, update the preferences. | 256 // The user changed when the bookmark bar is shown, update the preferences. |
257 prefs->SetBoolean(prefs::kShowBookmarkBar, always_show); | 257 prefs->SetBoolean(prefs::kShowBookmarkBar, always_show); |
258 } | 258 } |
259 | 259 |
260 string16 FormatBookmarkURLForDisplay(const GURL& url, | 260 string16 FormatBookmarkURLForDisplay(const GURL& url, |
261 const PrefService* prefs) { | 261 const PrefService* prefs) { |
262 std::string languages; | 262 std::string languages; |
263 if (prefs) | 263 if (prefs) |
(...skipping 18 matching lines...) Expand all Loading... |
282 | 282 |
283 return chrome::IsInstantExtendedAPIEnabled() && !profile->IsOffTheRecord(); | 283 return chrome::IsInstantExtendedAPIEnabled() && !profile->IsOffTheRecord(); |
284 } | 284 } |
285 | 285 |
286 bool ShouldShowAppsShortcutInBookmarkBar(Profile* profile) { | 286 bool ShouldShowAppsShortcutInBookmarkBar(Profile* profile) { |
287 return IsAppsShortcutEnabled(profile) && | 287 return IsAppsShortcutEnabled(profile) && |
288 profile->GetPrefs()->GetBoolean(prefs::kShowAppsShortcutInBookmarkBar); | 288 profile->GetPrefs()->GetBoolean(prefs::kShowAppsShortcutInBookmarkBar); |
289 } | 289 } |
290 | 290 |
291 } // namespace chrome | 291 } // namespace chrome |
OLD | NEW |