| 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 23 matching lines...) Expand all Loading... |
| 34 return web_ui && NewTabUI::FromWebUIController(web_ui->GetController()); | 34 return web_ui && NewTabUI::FromWebUIController(web_ui->GetController()); |
| 35 } | 35 } |
| 36 | 36 |
| 37 bool IsInstantNTP(content::WebContents* web_contents) { | 37 bool IsInstantNTP(content::WebContents* web_contents) { |
| 38 // Use the committed entry so the bookmarks bar disappears at the same time | 38 // Use the committed entry so the bookmarks bar disappears at the same time |
| 39 // the page does. | 39 // the page does. |
| 40 const content::NavigationEntry* entry = | 40 const content::NavigationEntry* entry = |
| 41 web_contents->GetController().GetLastCommittedEntry(); | 41 web_contents->GetController().GetLastCommittedEntry(); |
| 42 if (!entry) | 42 if (!entry) |
| 43 entry = web_contents->GetController().GetVisibleEntry(); | 43 entry = web_contents->GetController().GetVisibleEntry(); |
| 44 return chrome::NavEntryIsInstantNTP(web_contents, entry); | 44 return search::NavEntryIsInstantNTP(web_contents, entry); |
| 45 } | 45 } |
| 46 | 46 |
| 47 } // namespace | 47 } // namespace |
| 48 | 48 |
| 49 DEFINE_WEB_CONTENTS_USER_DATA_KEY(BookmarkTabHelper); | 49 DEFINE_WEB_CONTENTS_USER_DATA_KEY(BookmarkTabHelper); |
| 50 | 50 |
| 51 BookmarkTabHelper::~BookmarkTabHelper() { | 51 BookmarkTabHelper::~BookmarkTabHelper() { |
| 52 if (bookmark_model_) | 52 if (bookmark_model_) |
| 53 bookmark_model_->RemoveObserver(this); | 53 bookmark_model_->RemoveObserver(this); |
| 54 } | 54 } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 const content::LoadCommittedDetails& /*details*/, | 139 const content::LoadCommittedDetails& /*details*/, |
| 140 const content::FrameNavigateParams& /*params*/) { | 140 const content::FrameNavigateParams& /*params*/) { |
| 141 UpdateStarredStateForCurrentURL(); | 141 UpdateStarredStateForCurrentURL(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void BookmarkTabHelper::DidStartNavigationToPendingEntry( | 144 void BookmarkTabHelper::DidStartNavigationToPendingEntry( |
| 145 const GURL& /*url*/, | 145 const GURL& /*url*/, |
| 146 content::NavigationController::ReloadType /*reload_type*/) { | 146 content::NavigationController::ReloadType /*reload_type*/) { |
| 147 UpdateStarredStateForCurrentURL(); | 147 UpdateStarredStateForCurrentURL(); |
| 148 } | 148 } |
| OLD | NEW |