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

Side by Side Diff: ios/chrome/browser/reading_list/reading_list_web_state_observer.mm

Issue 2763233003: Move ReadingList model to components/reading_list/core (Closed)
Patch Set: feedback Created 3 years, 9 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ios/chrome/browser/reading_list/reading_list_web_state_observer.h" 5 #include "ios/chrome/browser/reading_list/reading_list_web_state_observer.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
11 #include "components/reading_list/ios/reading_list_model.h" 11 #include "components/reading_list/core/reading_list_model.h"
12 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 12 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
13 #include "ios/chrome/browser/chrome_url_constants.h" 13 #include "ios/chrome/browser/chrome_url_constants.h"
14 #include "ios/chrome/browser/reading_list/offline_url_utils.h" 14 #include "ios/chrome/browser/reading_list/offline_url_utils.h"
15 #include "ios/chrome/browser/reading_list/reading_list_model_factory.h" 15 #include "ios/chrome/browser/reading_list/reading_list_model_factory.h"
16 #include "ios/web/public/navigation_item.h" 16 #include "ios/web/public/navigation_item.h"
17 #include "ios/web/public/navigation_manager.h" 17 #include "ios/web/public/navigation_manager.h"
18 #include "ios/web/public/reload_type.h" 18 #include "ios/web/public/reload_type.h"
19 #include "ios/web/public/web_state/web_state_user_data.h" 19 #include "ios/web/public/web_state/web_state_user_data.h"
20 20
21 #if !defined(__has_feature) || !__has_feature(objc_arc) 21 #if !defined(__has_feature) || !__has_feature(objc_arc)
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 // on next navigation. 314 // on next navigation.
315 // Trigger a new navigation on the offline URL. 315 // Trigger a new navigation on the offline URL.
316 web::WebState::OpenURLParams params(url, item->GetReferrer(), 316 web::WebState::OpenURLParams params(url, item->GetReferrer(),
317 WindowOpenDisposition::CURRENT_TAB, 317 WindowOpenDisposition::CURRENT_TAB,
318 item->GetTransitionType(), NO); 318 item->GetTransitionType(), NO);
319 web_state()->OpenURL(params); 319 web_state()->OpenURL(params);
320 } 320 }
321 reading_list_model_->SetReadStatus(entry->URL(), true); 321 reading_list_model_->SetReadStatus(entry->URL(), true);
322 UMA_HISTOGRAM_BOOLEAN("ReadingList.OfflineVersionDisplayed", true); 322 UMA_HISTOGRAM_BOOLEAN("ReadingList.OfflineVersionDisplayed", true);
323 } 323 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698