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

Side by Side Diff: chrome/browser/ui/webui/offline/offline_internals_ui.cc

Issue 2274733002: [Offline pages] Add null pointer checks in offline internals code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incognito Created 4 years, 3 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 "chrome/browser/ui/webui/offline/offline_internals_ui.h" 5 #include "chrome/browser/ui/webui/offline/offline_internals_ui.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h " 9 #include "chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h "
10 #include "chrome/common/url_constants.h" 10 #include "chrome/common/url_constants.h"
(...skipping 11 matching lines...) Expand all
22 // Required resources. 22 // Required resources.
23 html_source->SetJsonPath("strings.js"); 23 html_source->SetJsonPath("strings.js");
24 html_source->AddResourcePath("offline_internals.css", 24 html_source->AddResourcePath("offline_internals.css",
25 IDR_OFFLINE_INTERNALS_CSS); 25 IDR_OFFLINE_INTERNALS_CSS);
26 html_source->AddResourcePath("offline_internals.js", 26 html_source->AddResourcePath("offline_internals.js",
27 IDR_OFFLINE_INTERNALS_JS); 27 IDR_OFFLINE_INTERNALS_JS);
28 html_source->AddResourcePath("offline_internals_browser_proxy.js", 28 html_source->AddResourcePath("offline_internals_browser_proxy.js",
29 IDR_OFFLINE_INTERNALS_BROWSER_PROXY_JS); 29 IDR_OFFLINE_INTERNALS_BROWSER_PROXY_JS);
30 html_source->SetDefaultResource(IDR_OFFLINE_INTERNALS_HTML); 30 html_source->SetDefaultResource(IDR_OFFLINE_INTERNALS_HTML);
31 31
32 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), html_source); 32 Profile* profile = Profile::FromWebUI(web_ui);
33 html_source->AddBoolean("isIncognito", profile->IsOffTheRecord());
34
35 content::WebUIDataSource::Add(profile, html_source);
33 36
34 web_ui->AddMessageHandler( 37 web_ui->AddMessageHandler(
35 new offline_internals::OfflineInternalsUIMessageHandler()); 38 new offline_internals::OfflineInternalsUIMessageHandler());
36 } 39 }
37 40
38 OfflineInternalsUI::~OfflineInternalsUI() {} 41 OfflineInternalsUI::~OfflineInternalsUI() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698