OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |