| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/enhanced_bookmarks/android/enhanced_bookmark_tab_helper
.h" | |
| 6 | |
| 7 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" | |
| 8 #include "chrome/browser/browser_process.h" | |
| 9 #include "chrome/browser/enhanced_bookmarks/android/bookmark_image_service_andro
id.h" | |
| 10 #include "chrome/browser/enhanced_bookmarks/android/bookmark_image_service_facto
ry.h" | |
| 11 #include "chrome/browser/profiles/profile.h" | |
| 12 | |
| 13 using enhanced_bookmarks::BookmarkImageServiceAndroid; | |
| 14 using enhanced_bookmarks::BookmarkImageServiceFactory; | |
| 15 | |
| 16 DEFINE_WEB_CONTENTS_USER_DATA_KEY(EnhancedBookmarkTabHelper); | |
| 17 | |
| 18 void EnhancedBookmarkTabHelper::DocumentOnLoadCompletedInMainFrame() { | |
| 19 Profile* profile = | |
| 20 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | |
| 21 | |
| 22 if (profile->IsOffTheRecord()) | |
| 23 return; | |
| 24 | |
| 25 if (!IsEnhancedBookmarksEnabled()) | |
| 26 return; | |
| 27 | |
| 28 BookmarkImageServiceAndroid* storage = | |
| 29 static_cast<BookmarkImageServiceAndroid*>( | |
| 30 BookmarkImageServiceFactory::GetForBrowserContext(profile)); | |
| 31 storage->FinishSuccessfulPageLoadForTab(web_contents(), true); | |
| 32 } | |
| 33 | |
| 34 EnhancedBookmarkTabHelper::EnhancedBookmarkTabHelper( | |
| 35 content::WebContents* contents) | |
| 36 : content::WebContentsObserver(contents) { | |
| 37 } | |
| OLD | NEW |