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

Unified Diff: components/webui_generator/view_model.cc

Issue 1181703008: Removed webui_generator and new OOBE UI placeholder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed empty line. Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/webui_generator/view_model.h ('k') | components/webui_generator/web_ui_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webui_generator/view_model.cc
diff --git a/components/webui_generator/view_model.cc b/components/webui_generator/view_model.cc
deleted file mode 100644
index d81ce98752807e6361fcf95b7f7032f49b6ddd28..0000000000000000000000000000000000000000
--- a/components/webui_generator/view_model.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-// 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 "components/webui_generator/view_model.h"
-
-#include "components/webui_generator/view.h"
-
-namespace webui_generator {
-
-ViewModel::ContextEditor::ContextEditor(ViewModel& view_model)
- : view_model_(view_model), context_(view_model_.context()) {
-}
-
-ViewModel::ContextEditor::~ContextEditor() {
- view_model_.CommitContextChanges();
-}
-
-const ViewModel::ContextEditor& ViewModel::ContextEditor::SetBoolean(
- const KeyType& key,
- bool value) const {
- context_.SetBoolean(key, value);
- return *this;
-}
-
-const ViewModel::ContextEditor& ViewModel::ContextEditor::SetInteger(
- const KeyType& key,
- int value) const {
- context_.SetInteger(key, value);
- return *this;
-}
-
-const ViewModel::ContextEditor& ViewModel::ContextEditor::SetDouble(
- const KeyType& key,
- double value) const {
- context_.SetDouble(key, value);
- return *this;
-}
-
-const ViewModel::ContextEditor& ViewModel::ContextEditor::SetString(
- const KeyType& key,
- const std::string& value) const {
- context_.SetString(key, value);
- return *this;
-}
-
-const ViewModel::ContextEditor& ViewModel::ContextEditor::SetString(
- const KeyType& key,
- const base::string16& value) const {
- context_.SetString(key, value);
- return *this;
-}
-
-const ViewModel::ContextEditor& ViewModel::ContextEditor::SetStringList(
- const KeyType& key,
- const StringList& value) const {
- context_.SetStringList(key, value);
- return *this;
-}
-
-const ViewModel::ContextEditor& ViewModel::ContextEditor::SetString16List(
- const KeyType& key,
- const String16List& value) const {
- context_.SetString16List(key, value);
- return *this;
-}
-
-ViewModel::ViewModel() : view_(nullptr) {
-}
-
-ViewModel::~ViewModel() {
-}
-
-void ViewModel::SetView(View* view) {
- view_ = view;
- Initialize();
-}
-
-void ViewModel::OnChildrenReady() {
- OnAfterChildrenReady();
- view_->OnViewModelReady();
-}
-
-void ViewModel::UpdateContext(const base::DictionaryValue& diff) {
- std::vector<std::string> changed_keys;
- context_.ApplyChanges(diff, &changed_keys);
- OnContextChanged(changed_keys);
-}
-
-void ViewModel::OnEvent(const std::string& event) {
-}
-
-ViewModel::ContextEditor ViewModel::GetContextEditor() {
- return ContextEditor(*this);
-}
-
-void ViewModel::CommitContextChanges() {
- if (!context().HasChanges())
- return;
-
- base::DictionaryValue diff;
- context().GetChangesAndReset(&diff);
- view_->OnContextChanged(diff);
-}
-
-} // namespace webui_generator
« no previous file with comments | « components/webui_generator/view_model.h ('k') | components/webui_generator/web_ui_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698