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 #include "mandoline/ui/browser/desktop/desktop_ui.h" | 5 #include "mandoline/ui/browser/desktop/desktop_ui.h" |
6 | 6 |
7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "mandoline/ui/aura/native_widget_view_manager.h" | 9 #include "mandoline/ui/aura/native_widget_view_manager.h" |
10 #include "mandoline/ui/browser/browser.h" | 10 #include "mandoline/ui/browser/browser.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 mojo::TypeConverter<mojo::Rect, gfx::Rect>::Convert(host->bounds())); | 84 mojo::TypeConverter<mojo::Rect, gfx::Rect>::Convert(host->bounds())); |
85 } | 85 } |
86 } | 86 } |
87 | 87 |
88 //////////////////////////////////////////////////////////////////////////////// | 88 //////////////////////////////////////////////////////////////////////////////// |
89 // DesktopUI, views::ButtonListener implementation: | 89 // DesktopUI, views::ButtonListener implementation: |
90 | 90 |
91 void DesktopUI::ButtonPressed(views::Button* sender, const ui::Event& event) { | 91 void DesktopUI::ButtonPressed(views::Button* sender, const ui::Event& event) { |
92 if (!omnibox_.get()) { | 92 if (!omnibox_.get()) { |
93 DCHECK(!client_binding_.is_bound()); | 93 DCHECK(!client_binding_.is_bound()); |
94 application_impl_->ConnectToService("mojo:omnibox", &omnibox_); | 94 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
| 95 request->url = mojo::String::From("mojo:omnibox"); |
| 96 application_impl_->ConnectToService(request.Pass(), &omnibox_); |
95 OmniboxClientPtr client; | 97 OmniboxClientPtr client; |
96 client_binding_.Bind(&client); | 98 client_binding_.Bind(&client); |
97 omnibox_->SetClient(client.Pass()); | 99 omnibox_->SetClient(client.Pass()); |
98 } | 100 } |
99 omnibox_->ShowForURL(mojo::String::From(browser_->current_url().spec())); | 101 omnibox_->ShowForURL(mojo::String::From(browser_->current_url().spec())); |
100 } | 102 } |
101 | 103 |
102 //////////////////////////////////////////////////////////////////////////////// | 104 //////////////////////////////////////////////////////////////////////////////// |
103 // BrowserUI, public: | 105 // BrowserUI, public: |
104 | 106 |
105 // static | 107 // static |
106 BrowserUI* BrowserUI::Create(Browser* browser, | 108 BrowserUI* BrowserUI::Create(Browser* browser, |
107 mojo::ApplicationImpl* application_impl) { | 109 mojo::ApplicationImpl* application_impl) { |
108 return new DesktopUI(browser, application_impl); | 110 return new DesktopUI(browser, application_impl); |
109 } | 111 } |
110 | 112 |
111 } // namespace mandoline | 113 } // namespace mandoline |
OLD | NEW |