| 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/webtest/webtest.h" | 5 #include "mash/webtest/webtest.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // navigation::mojom::ViewClient: | 101 // navigation::mojom::ViewClient: |
| 102 void LoadingStateChanged(bool is_loading) override {} | 102 void LoadingStateChanged(bool is_loading) override {} |
| 103 void NavigationStateChanged(const GURL& url, | 103 void NavigationStateChanged(const GURL& url, |
| 104 const mojo::String& title, | 104 const mojo::String& title, |
| 105 bool can_go_back, | 105 bool can_go_back, |
| 106 bool can_go_forward) override { | 106 bool can_go_forward) override { |
| 107 current_title_ = base::UTF8ToUTF16(title.get()); | 107 current_title_ = base::UTF8ToUTF16(title.get()); |
| 108 GetWidget()->UpdateWindowTitle(); | 108 GetWidget()->UpdateWindowTitle(); |
| 109 } | 109 } |
| 110 void LoadProgressChanged(double progress) override {} | 110 void LoadProgressChanged(double progress) override {} |
| 111 void UpdateHoverURL(const GURL& url) override {} |
| 111 void ViewCreated(navigation::mojom::ViewPtr view, | 112 void ViewCreated(navigation::mojom::ViewPtr view, |
| 112 navigation::mojom::ViewClientRequest request, | 113 navigation::mojom::ViewClientRequest request, |
| 113 bool is_popup, | 114 bool is_popup, |
| 114 const gfx::Rect& initial_rect, | 115 const gfx::Rect& initial_rect, |
| 115 bool user_gesture) override { | 116 bool user_gesture) override { |
| 116 views::Widget* window = views::Widget::CreateWindowWithContextAndBounds( | 117 views::Widget* window = views::Widget::CreateWindowWithContextAndBounds( |
| 117 new UI(webtest_, std::move(view), std::move(request)), nullptr, | 118 new UI(webtest_, std::move(view), std::move(request)), nullptr, |
| 118 initial_rect); | 119 initial_rect); |
| 119 window->Show(); | 120 window->Show(); |
| 120 webtest_->AddWindow(window); | 121 webtest_->AddWindow(window); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 AddWindow(window); | 186 AddWindow(window); |
| 186 } | 187 } |
| 187 | 188 |
| 188 void Webtest::Create(shell::Connection* connection, | 189 void Webtest::Create(shell::Connection* connection, |
| 189 mojom::LaunchableRequest request) { | 190 mojom::LaunchableRequest request) { |
| 190 bindings_.AddBinding(this, std::move(request)); | 191 bindings_.AddBinding(this, std::move(request)); |
| 191 } | 192 } |
| 192 | 193 |
| 193 } // namespace webtest | 194 } // namespace webtest |
| 194 } // namespace mash | 195 } // namespace mash |
| OLD | NEW |