Index: chrome/browser/ui/webui/demo_ui/demo.cc |
diff --git a/chrome/browser/ui/webui/demo_ui/demo.cc b/chrome/browser/ui/webui/demo_ui/demo.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7405a47390645d4d401c5b50749094a41e77f06d |
--- /dev/null |
+++ b/chrome/browser/ui/webui/demo_ui/demo.cc |
@@ -0,0 +1,25 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/ui/webui/demo_ui/demo.h" |
+ |
+#include "chrome/browser/profiles/profile.h" |
+ |
+void Demo::Register() { |
+ SetFactory( |
+ [](content::BrowserContext* context) -> gen::DemoViewModel* { |
+ return new Demo(Profile::FromBrowserContext(context)); |
+ }); |
+} |
+ |
+Demo::Demo(Profile* profile) : profile_(profile) { |
+} |
+ |
+Demo::~Demo() { |
+} |
+ |
+void Demo::Initialize() { |
+ GetContextEditor().SetString(kContextKeyUsername, |
+ profile_->GetProfileUserName()); |
+} |