| 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "mojo/public/cpp/bindings/binding.h" | 9 #include "mojo/public/cpp/bindings/binding.h" |
| 10 #include "services/navigation/public/interfaces/view.mojom.h" | 10 #include "services/navigation/public/interfaces/view.mojom.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 // mojom::ViewClient: | 39 // mojom::ViewClient: |
| 40 void OpenURL(mojom::OpenURLParamsPtr params) override {} | 40 void OpenURL(mojom::OpenURLParamsPtr params) override {} |
| 41 void LoadingStateChanged(bool is_loading) override { | 41 void LoadingStateChanged(bool is_loading) override { |
| 42 // Should see loading start, then stop. | 42 // Should see loading start, then stop. |
| 43 if (++load_count_ == 2 && loop_) | 43 if (++load_count_ == 2 && loop_) |
| 44 loop_->Quit(); | 44 loop_->Quit(); |
| 45 } | 45 } |
| 46 void NavigationStateChanged(const GURL& url, | 46 void NavigationStateChanged(const GURL& url, |
| 47 const mojo::String& title, | 47 const std::string& title, |
| 48 bool can_go_back, | 48 bool can_go_back, |
| 49 bool can_go_forward) override {} | 49 bool can_go_forward) override {} |
| 50 void LoadProgressChanged(double progress) override {} | 50 void LoadProgressChanged(double progress) override {} |
| 51 void UpdateHoverURL(const GURL& url) override {} | 51 void UpdateHoverURL(const GURL& url) override {} |
| 52 void ViewCreated(mojom::ViewPtr, | 52 void ViewCreated(mojom::ViewPtr, |
| 53 mojom::ViewClientRequest, | 53 mojom::ViewClientRequest, |
| 54 bool, | 54 bool, |
| 55 const gfx::Rect&, | 55 const gfx::Rect&, |
| 56 bool) override {} | 56 bool) override {} |
| 57 void Close() override {} | 57 void Close() override {} |
| (...skipping 21 matching lines...) Expand all Loading... |
| 79 mojom::ViewPtr view; | 79 mojom::ViewPtr view; |
| 80 view_factory->CreateView(GetViewClient(), GetProxy(&view)); | 80 view_factory->CreateView(GetViewClient(), GetProxy(&view)); |
| 81 view->NavigateTo(GURL("about:blank")); | 81 view->NavigateTo(GURL("about:blank")); |
| 82 | 82 |
| 83 base::RunLoop loop; | 83 base::RunLoop loop; |
| 84 QuitOnLoadingStateChange(&loop); | 84 QuitOnLoadingStateChange(&loop); |
| 85 loop.Run(); | 85 loop.Run(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace navigation | 88 } // namespace navigation |
| OLD | NEW |