OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/file_util.h" | |
6 #include "base/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
7 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
8 #include "base/path_service.h" | 7 #include "base/path_service.h" |
9 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
10 #include "base/values.h" | 9 #include "base/values.h" |
11 #include "content/browser/renderer_host/render_view_host_impl.h" | 10 #include "content/browser/renderer_host/render_view_host_impl.h" |
12 #include "content/browser/site_instance_impl.h" | 11 #include "content/browser/site_instance_impl.h" |
13 #include "content/browser/web_contents/web_contents_impl.h" | 12 #include "content/browser/web_contents/web_contents_impl.h" |
14 #include "content/common/content_constants_internal.h" | 13 #include "content/common/content_constants_internal.h" |
15 #include "content/public/browser/navigation_controller.h" | 14 #include "content/public/browser/navigation_controller.h" |
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 iter != observers_.end(); ++iter) { | 1042 iter != observers_.end(); ++iter) { |
1044 (*iter)->ClearParent(); | 1043 (*iter)->ClearParent(); |
1045 } | 1044 } |
1046 } | 1045 } |
1047 void AddObserverToRVH(RenderViewHost* rvh) { | 1046 void AddObserverToRVH(RenderViewHost* rvh) { |
1048 observers_.push_back(new RVHObserver(this, rvh)); | 1047 observers_.push_back(new RVHObserver(this, rvh)); |
1049 } | 1048 } |
1050 size_t GetNumObservers() const { | 1049 size_t GetNumObservers() const { |
1051 return observers_.size(); | 1050 return observers_.size(); |
1052 } | 1051 } |
| 1052 |
1053 private: | 1053 private: |
1054 friend class RVHObserver; | 1054 friend class RVHObserver; |
1055 class RVHObserver : public RenderViewHostObserver { | 1055 class RVHObserver : public RenderViewHostObserver { |
1056 public: | 1056 public: |
1057 RVHObserver(RenderViewHostObserverArray* parent, RenderViewHost* rvh) | 1057 RVHObserver(RenderViewHostObserverArray* parent, RenderViewHost* rvh) |
1058 : RenderViewHostObserver(rvh), | 1058 : RenderViewHostObserver(rvh), |
1059 parent_(parent) { | 1059 parent_(parent) { |
1060 } | 1060 } |
1061 virtual void RenderViewHostDestroyed(RenderViewHost* rvh) OVERRIDE { | 1061 virtual void RenderViewHostDestroyed(RenderViewHost* rvh) OVERRIDE { |
1062 if (parent_) | 1062 if (parent_) |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1200 NavigateToURL(shell(), https_server.GetURL("files/title1.html")); | 1200 NavigateToURL(shell(), https_server.GetURL("files/title1.html")); |
1201 | 1201 |
1202 // Make sure it ends up at the right page. | 1202 // Make sure it ends up at the right page. |
1203 WaitForLoadStop(shell()->web_contents()); | 1203 WaitForLoadStop(shell()->web_contents()); |
1204 EXPECT_EQ(https_server.GetURL("files/title1.html"), | 1204 EXPECT_EQ(https_server.GetURL("files/title1.html"), |
1205 shell()->web_contents()->GetURL()); | 1205 shell()->web_contents()->GetURL()); |
1206 EXPECT_EQ(new_site_instance, shell()->web_contents()->GetSiteInstance()); | 1206 EXPECT_EQ(new_site_instance, shell()->web_contents()->GetSiteInstance()); |
1207 } | 1207 } |
1208 | 1208 |
1209 } // namespace content | 1209 } // namespace content |
OLD | NEW |