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

Side by Side Diff: components/history/ios/browser/web_state_top_sites_observer.mm

Issue 2670693003: [ObjC ARC] Converts components/history/ios/browser:browser to ARC. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « components/history/ios/browser/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/history/ios/browser/web_state_top_sites_observer.h" 5 #include "components/history/ios/browser/web_state_top_sites_observer.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "components/history/core/browser/top_sites.h" 8 #include "components/history/core/browser/top_sites.h"
9 #include "ios/web/public/load_committed_details.h" 9 #include "ios/web/public/load_committed_details.h"
10 #include "ios/web/public/navigation_item.h" 10 #include "ios/web/public/navigation_item.h"
11 11
12 #if !defined(__has_feature) || !__has_feature(objc_arc)
13 #error "This file requires ARC support."
14 #endif
15
12 DEFINE_WEB_STATE_USER_DATA_KEY(history::WebStateTopSitesObserver); 16 DEFINE_WEB_STATE_USER_DATA_KEY(history::WebStateTopSitesObserver);
13 17
14 namespace history { 18 namespace history {
15 19
16 // static 20 // static
17 void WebStateTopSitesObserver::CreateForWebState(web::WebState* web_state, 21 void WebStateTopSitesObserver::CreateForWebState(web::WebState* web_state,
18 TopSites* top_sites) { 22 TopSites* top_sites) {
19 DCHECK(web_state); 23 DCHECK(web_state);
20 if (!FromWebState(web_state)) { 24 if (!FromWebState(web_state)) {
21 web_state->SetUserData(UserDataKey(), 25 web_state->SetUserData(UserDataKey(),
(...skipping 10 matching lines...) Expand all
32 } 36 }
33 37
34 void WebStateTopSitesObserver::NavigationItemCommitted( 38 void WebStateTopSitesObserver::NavigationItemCommitted(
35 const web::LoadCommittedDetails& load_details) { 39 const web::LoadCommittedDetails& load_details) {
36 DCHECK(load_details.item); 40 DCHECK(load_details.item);
37 if (top_sites_) 41 if (top_sites_)
38 top_sites_->OnNavigationCommitted(load_details.item->GetURL()); 42 top_sites_->OnNavigationCommitted(load_details.item->GetURL());
39 } 43 }
40 44
41 } // namespace history 45 } // namespace history
OLDNEW
« no previous file with comments | « components/history/ios/browser/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698