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/desktop_ui/browser_window.h" | 5 #include "mandoline/ui/desktop_ui/browser_window.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 root_ = root; | 195 root_ = root; |
196 | 196 |
197 host_->SetTitle("Mandoline"); | 197 host_->SetTitle("Mandoline"); |
198 | 198 |
199 content_ = root_->connection()->NewWindow(); | 199 content_ = root_->connection()->NewWindow(); |
200 Init(root_); | 200 Init(root_); |
201 | 201 |
202 host_->SetSize(mojo::Size::From(gfx::Size(1280, 800))); | 202 host_->SetSize(mojo::Size::From(gfx::Size(1280, 800))); |
203 | 203 |
204 root_->AddChild(content_); | 204 root_->AddChild(content_); |
| 205 host_->SetActivationParent(root_->id(), true); |
205 content_->SetVisible(true); | 206 content_->SetVisible(true); |
206 | 207 |
207 web_view_.Init(app_, content_); | 208 web_view_.Init(app_, content_); |
208 | 209 |
209 host_->AddAccelerator( | 210 host_->AddAccelerator( |
210 static_cast<uint32_t>(BrowserCommand::CLOSE), | 211 static_cast<uint32_t>(BrowserCommand::CLOSE), |
211 mus::CreateKeyMatcher(mus::mojom::KEYBOARD_CODE_W, | 212 mus::CreateKeyMatcher(mus::mojom::KEYBOARD_CODE_W, |
212 mus::mojom::EVENT_FLAGS_CONTROL_DOWN)); | 213 mus::mojom::EVENT_FLAGS_CONTROL_DOWN)); |
213 host_->AddAccelerator( | 214 host_->AddAccelerator( |
214 static_cast<uint32_t>(BrowserCommand::FOCUS_OMNIBOX), | 215 static_cast<uint32_t>(BrowserCommand::FOCUS_OMNIBOX), |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 content_bounds.set_width(DIPSToPixels(progress_bar_bounds.width())); | 446 content_bounds.set_width(DIPSToPixels(progress_bar_bounds.width())); |
446 content_bounds.set_height(host->bounds().height() - content_bounds.y() - | 447 content_bounds.set_height(host->bounds().height() - content_bounds.y() - |
447 DIPSToPixels(10)); | 448 DIPSToPixels(10)); |
448 content_->SetBounds(content_bounds); | 449 content_->SetBounds(content_bounds); |
449 | 450 |
450 // The omnibox view bounds are in physical pixels. | 451 // The omnibox view bounds are in physical pixels. |
451 omnibox_view_->SetBounds(bounds_in_physical_pixels); | 452 omnibox_view_->SetBounds(bounds_in_physical_pixels); |
452 } | 453 } |
453 | 454 |
454 } // namespace mandoline | 455 } // namespace mandoline |
OLD | NEW |