OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MANDOLINE_UI_BROWSER_DESKTOP_DESKTOP_UI_H_ | 5 #ifndef MANDOLINE_UI_BROWSER_DESKTOP_DESKTOP_UI_H_ |
6 #define MANDOLINE_UI_BROWSER_DESKTOP_DESKTOP_UI_H_ | 6 #define MANDOLINE_UI_BROWSER_DESKTOP_DESKTOP_UI_H_ |
7 | 7 |
8 #include "mandoline/ui/aura/aura_init.h" | 8 #include "mandoline/ui/aura/aura_init.h" |
9 #include "mandoline/ui/browser/browser_ui.h" | 9 #include "mandoline/ui/browser/browser_ui.h" |
10 #include "ui/views/controls/textfield/textfield_controller.h" | 10 #include "mandoline/ui/browser/omnibox.mojom.h" |
| 11 #include "ui/views/controls/button/button.h" |
11 #include "ui/views/layout/layout_manager.h" | 12 #include "ui/views/layout/layout_manager.h" |
12 | 13 |
13 namespace mojo { | 14 namespace mojo { |
14 class Shell; | 15 class Shell; |
15 class View; | 16 class View; |
16 } | 17 } |
17 | 18 |
| 19 namespace views { |
| 20 class LabelButton; |
| 21 } |
| 22 |
18 namespace mandoline { | 23 namespace mandoline { |
19 | 24 |
20 class Browser; | 25 class Browser; |
21 | 26 |
22 class DesktopUI : public BrowserUI, | 27 class DesktopUI : public BrowserUI, |
23 public views::LayoutManager, | 28 public views::LayoutManager, |
24 public views::TextfieldController { | 29 public views::ButtonListener { |
25 public: | 30 public: |
26 DesktopUI(Browser* browser, mojo::Shell* shell); | 31 DesktopUI(Browser* browser, mojo::ApplicationImpl* application_impl); |
27 ~DesktopUI() override; | 32 ~DesktopUI() override; |
28 | 33 |
29 private: | 34 private: |
30 // Overridden from BrowserUI | 35 // Overridden from BrowserUI |
31 void Init(mojo::View* root, mojo::View* content) override; | 36 void Init(mojo::View* root) override; |
| 37 void OnURLChanged() override; |
32 | 38 |
33 // Overridden from views::LayoutManager: | 39 // Overridden from views::LayoutManager: |
34 gfx::Size GetPreferredSize(const views::View* view) const override; | 40 gfx::Size GetPreferredSize(const views::View* view) const override; |
35 void Layout(views::View* host) override; | 41 void Layout(views::View* host) override; |
36 | 42 |
37 // Overridden from views::TextfieldController: | 43 // Overridden from views::ButtonListener: |
38 bool HandleKeyEvent(views::Textfield* sender, | 44 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
39 const ui::KeyEvent& key_event) override; | |
40 | 45 |
41 AuraInit aura_init_; | 46 AuraInit aura_init_; |
42 Browser* browser_; | 47 Browser* browser_; |
43 mojo::Shell* shell_; | 48 mojo::ApplicationImpl* application_impl_; |
44 views::Textfield* omnibox_; | 49 views::LabelButton* omnibox_launcher_; |
45 mojo::View* root_; | 50 mojo::View* root_; |
46 mojo::View* content_; | 51 mojo::View* content_; |
| 52 OmniboxPtr omnibox_; |
| 53 mojo::Binding<OmniboxClient> client_binding_; |
47 | 54 |
48 DISALLOW_COPY_AND_ASSIGN(DesktopUI); | 55 DISALLOW_COPY_AND_ASSIGN(DesktopUI); |
49 }; | 56 }; |
50 | 57 |
51 } // namespace mandoline | 58 } // namespace mandoline |
52 | 59 |
53 #endif // MANDOLINE_UI_BROWSER_DESKTOP_DESKTOP_UI_H_ | 60 #endif // MANDOLINE_UI_BROWSER_DESKTOP_DESKTOP_UI_H_ |
OLD | NEW |