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.h" | 7 #include "chrome/browser/bookmarks/bookmark_model.h" |
8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
9 #include "chrome/browser/defaults.h" | 9 #include "chrome/browser/defaults.h" |
10 #include "chrome/browser/prefs/pref_service_syncable.h" | 10 #include "chrome/browser/prefs/pref_service_syncable.h" |
11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/search/search.h" | 12 #include "chrome/browser/search/search.h" |
13 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h" | 13 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h" |
14 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 14 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
15 #include "chrome/browser/ui/sad_tab.h" | 15 #include "chrome/browser/ui/sad_tab.h" |
16 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 16 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
17 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 18 #include "components/bookmarks/bookmark_pref_names.h" |
18 #include "content/public/browser/navigation_entry.h" | 19 #include "content/public/browser/navigation_entry.h" |
19 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
20 | 21 |
21 namespace { | 22 namespace { |
22 | 23 |
23 bool IsNTPWebUI(content::WebContents* web_contents) { | 24 bool IsNTPWebUI(content::WebContents* web_contents) { |
24 content::WebUI* web_ui = NULL; | 25 content::WebUI* web_ui = NULL; |
25 // Use the committed entry so the bookmarks bar disappears at the same time | 26 // Use the committed entry so the bookmarks bar disappears at the same time |
26 // the page does. | 27 // the page does. |
27 if (web_contents->GetController().GetLastCommittedEntry()) | 28 if (web_contents->GetController().GetLastCommittedEntry()) |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 void BookmarkTabHelper::BookmarkNodeChanged(BookmarkModel* model, | 127 void BookmarkTabHelper::BookmarkNodeChanged(BookmarkModel* model, |
127 const BookmarkNode* node) { | 128 const BookmarkNode* node) { |
128 UpdateStarredStateForCurrentURL(); | 129 UpdateStarredStateForCurrentURL(); |
129 } | 130 } |
130 | 131 |
131 void BookmarkTabHelper::DidNavigateMainFrame( | 132 void BookmarkTabHelper::DidNavigateMainFrame( |
132 const content::LoadCommittedDetails& /*details*/, | 133 const content::LoadCommittedDetails& /*details*/, |
133 const content::FrameNavigateParams& /*params*/) { | 134 const content::FrameNavigateParams& /*params*/) { |
134 UpdateStarredStateForCurrentURL(); | 135 UpdateStarredStateForCurrentURL(); |
135 } | 136 } |
OLD | NEW |