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

Side by Side Diff: ios/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc

Issue 2747143003: Check incognito profile appropriately on iOS (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | 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 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/ui/webui/ntp_tiles_internals_ui.h" 5 #include "ios/chrome/browser/ui/webui/ntp_tiles_internals_ui.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "components/grit/components_resources.h" 8 #include "components/grit/components_resources.h"
9 #include "components/ntp_tiles/field_trial.h" 9 #include "components/ntp_tiles/field_trial.h"
10 #include "components/ntp_tiles/most_visited_sites.h" 10 #include "components/ntp_tiles/most_visited_sites.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 ntp_tiles::NTPTilesInternalsMessageHandler handler_; 47 ntp_tiles::NTPTilesInternalsMessageHandler handler_;
48 48
49 DISALLOW_COPY_AND_ASSIGN(IOSNTPTilesInternalsMessageHandlerBridge); 49 DISALLOW_COPY_AND_ASSIGN(IOSNTPTilesInternalsMessageHandlerBridge);
50 }; 50 };
51 51
52 void IOSNTPTilesInternalsMessageHandlerBridge::RegisterMessages() { 52 void IOSNTPTilesInternalsMessageHandlerBridge::RegisterMessages() {
53 handler_.RegisterMessages(this); 53 handler_.RegisterMessages(this);
54 } 54 }
55 55
56 bool IOSNTPTilesInternalsMessageHandlerBridge::SupportsNTPTiles() { 56 bool IOSNTPTilesInternalsMessageHandlerBridge::SupportsNTPTiles() {
57 auto* state = ios::ChromeBrowserState::FromWebUIIOS(web_ui()); 57 return !ios::ChromeBrowserState::FromWebUIIOS(web_ui())->IsOffTheRecord();
58 return state == state->GetOriginalChromeBrowserState();
59 } 58 }
60 59
61 bool IOSNTPTilesInternalsMessageHandlerBridge::DoesSourceExist( 60 bool IOSNTPTilesInternalsMessageHandlerBridge::DoesSourceExist(
62 ntp_tiles::NTPTileSource source) { 61 ntp_tiles::NTPTileSource source) {
63 switch (source) { 62 switch (source) {
64 case ntp_tiles::NTPTileSource::TOP_SITES: 63 case ntp_tiles::NTPTileSource::TOP_SITES:
65 case ntp_tiles::NTPTileSource::SUGGESTIONS_SERVICE: 64 case ntp_tiles::NTPTileSource::SUGGESTIONS_SERVICE:
66 case ntp_tiles::NTPTileSource::POPULAR: 65 case ntp_tiles::NTPTileSource::POPULAR:
67 return true; 66 return true;
68 case ntp_tiles::NTPTileSource::WHITELIST: 67 case ntp_tiles::NTPTileSource::WHITELIST:
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 108
110 NTPTilesInternalsUI::NTPTilesInternalsUI(web::WebUIIOS* web_ui) 109 NTPTilesInternalsUI::NTPTilesInternalsUI(web::WebUIIOS* web_ui)
111 : web::WebUIIOSController(web_ui) { 110 : web::WebUIIOSController(web_ui) {
112 web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui), 111 web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui),
113 CreateNTPTilesInternalsHTMLSource()); 112 CreateNTPTilesInternalsHTMLSource());
114 web_ui->AddMessageHandler( 113 web_ui->AddMessageHandler(
115 base::MakeUnique<IOSNTPTilesInternalsMessageHandlerBridge>()); 114 base::MakeUnique<IOSNTPTilesInternalsMessageHandlerBridge>());
116 } 115 }
117 116
118 NTPTilesInternalsUI::~NTPTilesInternalsUI() {} 117 NTPTilesInternalsUI::~NTPTilesInternalsUI() {}
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698