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

Side by Side Diff: chrome/browser/enhanced_bookmarks/android/enhanced_bookmark_tab_helper.cc

Issue 899653003: [Enhanced Bookmark]Upstream image fetching code in android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 5 years, 10 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
OLDNEW
(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 bool is_enhanced_bookmarks_enabled =
26 IsEnhancedBookmarksEnabled(profile->GetPrefs());
27 if (!is_enhanced_bookmarks_enabled)
28 return;
29
30 BookmarkImageServiceAndroid* storage =
31 static_cast<BookmarkImageServiceAndroid*>(
32 BookmarkImageServiceFactory::GetForBrowserContext(profile));
33 storage->FinishSuccessfulPageLoadForTab(web_contents(),
34 is_enhanced_bookmarks_enabled);
35 }
36
37 EnhancedBookmarkTabHelper::EnhancedBookmarkTabHelper(
38 content::WebContents* contents)
39 : content::WebContentsObserver(contents) {
40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698