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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/oobe_ui.cc

Issue 67923002: Fixes for -Wunused-function on Linux, Android and ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase for realz Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chromeos/login/oobe_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 const char kLoginJSPath[] = "login.js"; 74 const char kLoginJSPath[] = "login.js";
75 const char kOobeJSPath[] = "oobe.js"; 75 const char kOobeJSPath[] = "oobe.js";
76 const char kKeyboardUtilsJSPath[] = "keyboard_utils.js"; 76 const char kKeyboardUtilsJSPath[] = "keyboard_utils.js";
77 const char kDemoUserLoginJSPath[] = "demo_user_login.js"; 77 const char kDemoUserLoginJSPath[] = "demo_user_login.js";
78 78
79 // Paths for deferred resource loading. 79 // Paths for deferred resource loading.
80 const char kEnrollmentHTMLPath[] = "enrollment.html"; 80 const char kEnrollmentHTMLPath[] = "enrollment.html";
81 const char kEnrollmentCSSPath[] = "enrollment.css"; 81 const char kEnrollmentCSSPath[] = "enrollment.css";
82 const char kEnrollmentJSPath[] = "enrollment.js"; 82 const char kEnrollmentJSPath[] = "enrollment.js";
83 83
84 // Filter handler of chrome://oobe data source.
85 bool HandleRequestCallback(
86 const std::string& path,
87 const content::WebUIDataSource::GotDataCallback& callback) {
88 if (UserManager::Get()->IsUserLoggedIn() &&
89 !UserManager::Get()->IsLoggedInAsStub() &&
90 !ScreenLocker::default_screen_locker()) {
91 scoped_refptr<base::RefCountedBytes> empty_bytes =
92 new base::RefCountedBytes();
93 callback.Run(empty_bytes.get());
94 return true;
95 }
96
97 return false;
98 }
99
100 // Creates a WebUIDataSource for chrome://oobe 84 // Creates a WebUIDataSource for chrome://oobe
101 content::WebUIDataSource* CreateOobeUIDataSource( 85 content::WebUIDataSource* CreateOobeUIDataSource(
102 const base::DictionaryValue& localized_strings, 86 const base::DictionaryValue& localized_strings,
103 const std::string& display_type) { 87 const std::string& display_type) {
104 content::WebUIDataSource* source = 88 content::WebUIDataSource* source =
105 content::WebUIDataSource::Create(chrome::kChromeUIOobeHost); 89 content::WebUIDataSource::Create(chrome::kChromeUIOobeHost);
106 source->SetUseJsonJSFormatV2(); 90 source->SetUseJsonJSFormatV2();
107 source->AddLocalizedStrings(localized_strings); 91 source->AddLocalizedStrings(localized_strings);
108 source->SetJsonPath(kStringsJSPath); 92 source->SetJsonPath(kStringsJSPath);
109 93
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 observer_list_, 463 observer_list_,
480 OnCurrentScreenChanged(current_screen_, new_screen)); 464 OnCurrentScreenChanged(current_screen_, new_screen));
481 current_screen_ = new_screen; 465 current_screen_ = new_screen;
482 } else { 466 } else {
483 NOTREACHED() << "Screen should be registered in InitializeScreenMaps()"; 467 NOTREACHED() << "Screen should be registered in InitializeScreenMaps()";
484 current_screen_ = SCREEN_UNKNOWN; 468 current_screen_ = SCREEN_UNKNOWN;
485 } 469 }
486 } 470 }
487 471
488 } // namespace chromeos 472 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc ('k') | chrome/browser/ui/webui/instant_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698