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

Side by Side Diff: chrome/browser/ui/webui/demo_ui/reuse/reuse_demo.cc

Issue 925333002: Demo UI made with a help of WUG toolkit (DO NOT SEND TO CQ). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/webui/demo_ui/reuse/reuse_demo.h"
6
7 ReuseDemo::ReuseDemo() {
8 }
9
10 ReuseDemo::~ReuseDemo() {
11 GetLeftEvents()->RemoveObserver(this);
12 GetRightEvents()->RemoveObserver(this);
13 }
14
15 void ReuseDemo::OnAfterChildrenReady() {
16 GetLeftEvents()->AddObserver(this);
17 GetRightEvents()->AddObserver(this);
18 EventsCounterChanged();
19 }
20
21 void ReuseDemo::EventsCounterChanged() {
22 GetContextEditor().SetInteger(
23 kContextKeyTotalClicks,
24 GetLeftEvents()->GetEventCounter() + GetRightEvents()->GetEventCounter());
25 }
26
27 EventsDemo* ReuseDemo::GetLeftEvents() const {
28 return static_cast<EventsDemo*>(gen::ReuseDemoViewModel::GetLeftEvents());
29 }
30
31 EventsDemo* ReuseDemo::GetRightEvents() const {
32 return static_cast<EventsDemo*>(gen::ReuseDemoViewModel::GetRightEvents());
33 }
34
35 void ReuseDemo::Register() {
36 SetFactory(
37 [](content::BrowserContext*)
38 -> gen::ReuseDemoViewModel* { return new ReuseDemo(); });
39 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/demo_ui/reuse/reuse_demo.h ('k') | chrome/browser/ui/webui/demo_ui/strings/strings_demo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698