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_tab_helper.h" | 5 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
6 | 6 |
7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
8 #include "chrome/browser/defaults.h" | 8 #include "chrome/browser/defaults.h" |
9 #include "chrome/browser/prefs/pref_service_syncable.h" | 9 #include "chrome/browser/prefs/pref_service_syncable.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 Profile* profile = | 63 Profile* profile = |
64 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | 64 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
65 | 65 |
66 #if !defined(OS_CHROMEOS) | 66 #if !defined(OS_CHROMEOS) |
67 if (profile->IsGuestSession()) | 67 if (profile->IsGuestSession()) |
68 return false; | 68 return false; |
69 #endif | 69 #endif |
70 | 70 |
71 PrefService* prefs = profile->GetPrefs(); | 71 PrefService* prefs = profile->GetPrefs(); |
72 if (prefs->IsManagedPreference(prefs::kShowBookmarkBar) && | 72 if (prefs->IsManagedPreference(bookmarks::prefs::kShowBookmarkBar) && |
73 !prefs->GetBoolean(prefs::kShowBookmarkBar)) | 73 !prefs->GetBoolean(bookmarks::prefs::kShowBookmarkBar)) |
74 return false; | 74 return false; |
75 | 75 |
76 return IsNTPWebUI(web_contents()) || IsInstantNTP(web_contents()); | 76 return IsNTPWebUI(web_contents()) || IsInstantNTP(web_contents()); |
77 } | 77 } |
78 | 78 |
79 BookmarkTabHelper::BookmarkTabHelper(content::WebContents* web_contents) | 79 BookmarkTabHelper::BookmarkTabHelper(content::WebContents* web_contents) |
80 : content::WebContentsObserver(web_contents), | 80 : content::WebContentsObserver(web_contents), |
81 is_starred_(false), | 81 is_starred_(false), |
82 bookmark_model_(NULL), | 82 bookmark_model_(NULL), |
83 delegate_(NULL), | 83 delegate_(NULL), |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 void BookmarkTabHelper::BookmarkNodeChanged(BookmarkModel* model, | 130 void BookmarkTabHelper::BookmarkNodeChanged(BookmarkModel* model, |
131 const BookmarkNode* node) { | 131 const BookmarkNode* node) { |
132 UpdateStarredStateForCurrentURL(); | 132 UpdateStarredStateForCurrentURL(); |
133 } | 133 } |
134 | 134 |
135 void BookmarkTabHelper::DidNavigateMainFrame( | 135 void BookmarkTabHelper::DidNavigateMainFrame( |
136 const content::LoadCommittedDetails& /*details*/, | 136 const content::LoadCommittedDetails& /*details*/, |
137 const content::FrameNavigateParams& /*params*/) { | 137 const content::FrameNavigateParams& /*params*/) { |
138 UpdateStarredStateForCurrentURL(); | 138 UpdateStarredStateForCurrentURL(); |
139 } | 139 } |
OLD | NEW |