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

Side by Side Diff: chrome/browser/ui/webui/md_history_ui.cc

Issue 2171513004: MD History: Hide sign in guide in guest mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: format Created 4 years, 5 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 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 "chrome/browser/ui/webui/md_history_ui.h" 5 #include "chrome/browser/ui/webui/md_history_ui.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/signin/signin_manager_factory.h" 10 #include "chrome/browser/signin/signin_manager_factory.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 IDS_SETTINGS_CLEAR_DATA_WEB_HISTORY_URL_IN_HISTORY))); 94 IDS_SETTINGS_CLEAR_DATA_WEB_HISTORY_URL_IN_HISTORY)));
95 95
96 bool allow_deleting_history = 96 bool allow_deleting_history =
97 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory); 97 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory);
98 source->AddBoolean("allowDeletingHistory", allow_deleting_history); 98 source->AddBoolean("allowDeletingHistory", allow_deleting_history);
99 99
100 bool group_by_domain = base::CommandLine::ForCurrentProcess()->HasSwitch( 100 bool group_by_domain = base::CommandLine::ForCurrentProcess()->HasSwitch(
101 switches::kHistoryEnableGroupByDomain) || profile->IsSupervised(); 101 switches::kHistoryEnableGroupByDomain) || profile->IsSupervised();
102 source->AddBoolean("groupByDomain", group_by_domain); 102 source->AddBoolean("groupByDomain", group_by_domain);
103 103
104 source->AddBoolean("isGuestSession", profile->IsGuestSession());
105
104 SigninManagerBase* signin_manager = 106 SigninManagerBase* signin_manager =
105 SigninManagerFactory::GetForProfile(profile); 107 SigninManagerFactory::GetForProfile(profile);
106 bool is_authenticated = signin_manager != nullptr && 108 bool is_authenticated = signin_manager != nullptr &&
107 signin_manager->IsAuthenticated(); 109 signin_manager->IsAuthenticated();
108 source->AddBoolean("isUserSignedIn", is_authenticated); 110 source->AddBoolean("isUserSignedIn", is_authenticated);
109 111
110 source->AddResourcePath("app.html", IDR_MD_HISTORY_APP_HTML); 112 source->AddResourcePath("app.html", IDR_MD_HISTORY_APP_HTML);
111 source->AddResourcePath("app.js", IDR_MD_HISTORY_APP_JS); 113 source->AddResourcePath("app.js", IDR_MD_HISTORY_APP_JS);
112 source->AddResourcePath("browser_service.html", 114 source->AddResourcePath("browser_service.html",
113 IDR_MD_HISTORY_BROWSER_SERVICE_HTML); 115 IDR_MD_HISTORY_BROWSER_SERVICE_HTML);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 base::FeatureList::ClearInstanceForTesting(); 199 base::FeatureList::ClearInstanceForTesting();
198 base::FeatureList::SetInstance(std::move(feature_list)); 200 base::FeatureList::SetInstance(std::move(feature_list));
199 } 201 }
200 202
201 // static 203 // static
202 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( 204 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes(
203 ui::ScaleFactor scale_factor) { 205 ui::ScaleFactor scale_factor) {
204 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( 206 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale(
205 IDR_HISTORY_FAVICON, scale_factor); 207 IDR_HISTORY_FAVICON, scale_factor);
206 } 208 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698