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

Unified Diff: mandoline/ui/desktop_ui/find_bar_view.h

Issue 1371773003: mandoline: Add find in page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT to fix patch failure. Created 5 years, 3 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: mandoline/ui/desktop_ui/find_bar_view.h
diff --git a/mandoline/ui/desktop_ui/find_bar_view.h b/mandoline/ui/desktop_ui/find_bar_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..5612c1f101ec3ec12942ffd67b43727b143f12b0
--- /dev/null
+++ b/mandoline/ui/desktop_ui/find_bar_view.h
@@ -0,0 +1,55 @@
+// 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.
+
+#ifndef MANDOLINE_UI_DESKTOP_UI_FIND_BAR_VIEW_H_
+#define MANDOLINE_UI_DESKTOP_UI_FIND_BAR_VIEW_H_
+
+#include "ui/views/view.h"
+#include "ui/views/controls/button/label_button.h"
+#include "ui/views/controls/textfield/textfield_controller.h"
+
+namespace views {
+class BoxLayout;
+class Label;
+class Textfield;
+}
+
+namespace mandoline {
+
+class FindBarDelegate;
+
+// Owns the widgets which show the find bar.
+class FindBarView : public views::View,
+ public views::TextfieldController,
+ public views::ButtonListener {
+ public:
+ FindBarView(FindBarDelegate* delegate);
+ ~FindBarView() override;
+
+ void Show();
+ void Hide();
+
+ void SetMatchLabel(int result, int total);
+
+ private:
+ // Overridden from views::TextfieldController:
+ void ContentsChanged(views::Textfield* sender,
+ const base::string16& new_contents) override;
+
+ // Overridden from views::ButtonListener:
+ void ButtonPressed(views::Button* sender, const ui::Event& event) override;
+
+ FindBarDelegate* delegate_;
+
+ views::BoxLayout* layout_;
+ views::Textfield* text_field_;
+ views::Label* match_count_label_;
+ views::LabelButton* close_button_;
+
+ DISALLOW_COPY_AND_ASSIGN(FindBarView);
+};
+
+} // namespace mandoline
+
+#endif // MANDOLINE_UI_DESKTOP_UI_FIND_BAR_VIEW_H_

Powered by Google App Engine
This is Rietveld 408576698