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

Unified Diff: ash/login/views/contents_view.cc

Issue 2859363003: cros: Initial structure for views-based lock. (Closed)
Patch Set: Update session state in chrome Created 3 years, 7 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
Index: ash/login/views/contents_view.cc
diff --git a/ash/login/views/contents_view.cc b/ash/login/views/contents_view.cc
new file mode 100644
index 0000000000000000000000000000000000000000..950f4ccd4cd15ae4fb34cc362e4b7bc86a1aa746
--- /dev/null
+++ b/ash/login/views/contents_view.cc
@@ -0,0 +1,43 @@
+// Copyright 2017 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 "ash/login/views/contents_view.h"
+
+#include "base/strings/utf_string_conversions.h"
+#include "ui/views/background.h"
+#include "ui/views/border.h"
+#include "ui/views/layout/box_layout.h"
+
+namespace ash {
+
+ContentsView::ContentsView() {
+ auto* layout = new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0);
+ SetLayoutManager(layout);
+
+ {
James Cook 2017/05/08 22:04:20 any particular reason you're introducing new scope
jdufault 2017/05/08 23:02:34 Removed (I originally had a few more labels for te
+ views::Label* label = new views::Label();
+ label->SetBorder(views::CreateEmptyBorder(2, 3, 4, 5));
+ label->set_background(views::Background::CreateThemedSolidBackground(
+ label, ui::NativeTheme::kColorId_BubbleBackground));
+ label->SetText(base::ASCIIToUTF16("User"));
+ AddChildView(label);
+ }
+ {
+ unlock_button_ =
+ views::MdTextButton::Create(this, base::ASCIIToUTF16("Unlock"));
+ AddChildView(unlock_button_);
+ }
+}
+
+ContentsView::~ContentsView() {}
+
+void ContentsView::ButtonPressed(views::Button* sender,
+ const ui::Event& event) {
+ DCHECK(unlock_button_ == sender);
+
+ // TODO: Run mojo call that talks to backend which unlocks the device.
+ NOTIMPLEMENTED();
+}
+
+} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698