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

Side by Side Diff: chrome/browser/importer/profile_writer.cc

Issue 8135001: Fixed behavior of the bookmark bar visibility. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DCHECK_EQ instead of DCHECK Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/importer/profile_writer.h" 5 #include "chrome/browser/importer/profile_writer.h"
6 6
7 #include <map>
8 #include <set>
7 #include <string> 9 #include <string>
8 10
9 #include "base/string_number_conversions.h" 11 #include "base/string_number_conversions.h"
10 #include "base/stringprintf.h" 12 #include "base/stringprintf.h"
11 #include "base/threading/thread.h" 13 #include "base/threading/thread.h"
12 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
13 #include "chrome/browser/bookmarks/bookmark_model.h" 15 #include "chrome/browser/bookmarks/bookmark_model.h"
14 #include "chrome/browser/password_manager/password_store.h" 16 #include "chrome/browser/password_manager/password_store.h"
15 #include "chrome/browser/prefs/pref_service.h" 17 #include "chrome/browser/prefs/pref_service.h"
16 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 52
51 NOTREACHED(); 53 NOTREACHED();
52 return folder_name; 54 return folder_name;
53 } 55 }
54 56
55 // Shows the bookmarks toolbar. 57 // Shows the bookmarks toolbar.
56 void ShowBookmarkBar(Profile* profile) { 58 void ShowBookmarkBar(Profile* profile) {
57 PrefService* prefs = profile->GetPrefs(); 59 PrefService* prefs = profile->GetPrefs();
58 // Check whether the bookmark bar is shown in current pref. 60 // Check whether the bookmark bar is shown in current pref.
59 if (!prefs->GetBoolean(prefs::kShowBookmarkBar)) { 61 if (!prefs->GetBoolean(prefs::kShowBookmarkBar)) {
60 // Set the pref and notify the notification service.
61 prefs->SetBoolean(prefs::kShowBookmarkBar, true); 62 prefs->SetBoolean(prefs::kShowBookmarkBar, true);
62 prefs->ScheduleSavePersistentPrefs(); 63 prefs->ScheduleSavePersistentPrefs();
63 Source<Profile> source(profile);
64 NotificationService::current()->Notify(
65 chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, source,
66 NotificationService::NoDetails());
67 } 64 }
68 } 65 }
69 66
70 } // namespace 67 } // namespace
71 68
72 ProfileWriter::BookmarkEntry::BookmarkEntry() 69 ProfileWriter::BookmarkEntry::BookmarkEntry()
73 : in_toolbar(false), 70 : in_toolbar(false),
74 is_folder(false) {} 71 is_folder(false) {}
75 72
76 ProfileWriter::BookmarkEntry::~BookmarkEntry() {} 73 ProfileWriter::BookmarkEntry::~BookmarkEntry() {}
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 if (default_keyword && TemplateURL::SupportsReplacement(t_url)) 328 if (default_keyword && TemplateURL::SupportsReplacement(t_url))
332 model->SetDefaultSearchProvider(t_url); 329 model->SetDefaultSearchProvider(t_url);
333 } else { 330 } else {
334 // Don't add invalid TemplateURLs to the model. 331 // Don't add invalid TemplateURLs to the model.
335 delete t_url; 332 delete t_url;
336 } 333 }
337 } 334 }
338 } 335 }
339 336
340 ProfileWriter::~ProfileWriter() {} 337 ProfileWriter::~ProfileWriter() {}
OLDNEW
« no previous file with comments | « chrome/browser/importer/profile_writer.h ('k') | chrome/browser/policy/configuration_policy_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698