| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "mash/browser/browser.h" | 5 #include "mash/browser/browser.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 ~UI() override { | 568 ~UI() override { |
| 569 browser_->RemoveWindow(GetWidget()); | 569 browser_->RemoveWindow(GetWidget()); |
| 570 } | 570 } |
| 571 | 571 |
| 572 void NavigateTo(const GURL& url) { | 572 void NavigateTo(const GURL& url) { |
| 573 selected_view()->NavigateToURL(url); | 573 selected_view()->NavigateToURL(url); |
| 574 } | 574 } |
| 575 | 575 |
| 576 private: | 576 private: |
| 577 // Overridden from views::WidgetDelegate: | 577 // Overridden from views::WidgetDelegate: |
| 578 views::View* GetContentsView() override { return this; } | |
| 579 base::string16 GetWindowTitle() const override { | 578 base::string16 GetWindowTitle() const override { |
| 580 // TODO(beng): use resources. | 579 // TODO(beng): use resources. |
| 581 if (selected_view()->title().empty()) | 580 if (selected_view()->title().empty()) |
| 582 return base::ASCIIToUTF16("Browser"); | 581 return base::ASCIIToUTF16("Browser"); |
| 583 base::string16 format = base::ASCIIToUTF16("%s - Browser"); | 582 base::string16 format = base::ASCIIToUTF16("%s - Browser"); |
| 584 base::ReplaceFirstSubstringAfterOffset(&format, 0, base::ASCIIToUTF16("%s"), | 583 base::ReplaceFirstSubstringAfterOffset(&format, 0, base::ASCIIToUTF16("%s"), |
| 585 selected_view()->title()); | 584 selected_view()->title()); |
| 586 return format; | 585 return format; |
| 587 } | 586 } |
| 588 bool CanResize() const override { return true; } | 587 bool CanResize() const override { return true; } |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 AddWindow(window); | 895 AddWindow(window); |
| 897 } | 896 } |
| 898 | 897 |
| 899 void Browser::Create(const shell::Identity& remote_identity, | 898 void Browser::Create(const shell::Identity& remote_identity, |
| 900 mojom::LaunchableRequest request) { | 899 mojom::LaunchableRequest request) { |
| 901 bindings_.AddBinding(this, std::move(request)); | 900 bindings_.AddBinding(this, std::move(request)); |
| 902 } | 901 } |
| 903 | 902 |
| 904 } // namespace browser | 903 } // namespace browser |
| 905 } // namespace mash | 904 } // namespace mash |
| OLD | NEW |