OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/renderer_host/render_view_host.h" | 5 #include "content/browser/renderer_host/render_view_host.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 navigations_suspended_(false), | 98 navigations_suspended_(false), |
99 suspended_nav_message_(NULL), | 99 suspended_nav_message_(NULL), |
100 run_modal_reply_msg_(NULL), | 100 run_modal_reply_msg_(NULL), |
101 is_waiting_for_beforeunload_ack_(false), | 101 is_waiting_for_beforeunload_ack_(false), |
102 is_waiting_for_unload_ack_(false), | 102 is_waiting_for_unload_ack_(false), |
103 unload_ack_is_for_cross_site_transition_(false), | 103 unload_ack_is_for_cross_site_transition_(false), |
104 are_javascript_messages_suppressed_(false), | 104 are_javascript_messages_suppressed_(false), |
105 sudden_termination_allowed_(false), | 105 sudden_termination_allowed_(false), |
106 session_storage_namespace_(session_storage), | 106 session_storage_namespace_(session_storage), |
107 is_extension_process_(false), | 107 is_extension_process_(false), |
| 108 installed_app_(NULL), |
108 save_accessibility_tree_for_testing_(false), | 109 save_accessibility_tree_for_testing_(false), |
109 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { | 110 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { |
110 if (!session_storage_namespace_) { | 111 if (!session_storage_namespace_) { |
111 session_storage_namespace_ = | 112 session_storage_namespace_ = |
112 new SessionStorageNamespace(process()->profile()); | 113 new SessionStorageNamespace(process()->profile()); |
113 } | 114 } |
114 | 115 |
115 DCHECK(instance_); | 116 DCHECK(instance_); |
116 DCHECK(delegate_); | 117 DCHECK(delegate_); |
117 } | 118 } |
118 | 119 |
119 RenderViewHost::~RenderViewHost() { | 120 RenderViewHost::~RenderViewHost() { |
120 delegate()->RenderViewDeleted(this); | 121 delegate()->RenderViewDeleted(this); |
121 | 122 |
122 // Be sure to clean up any leftover state from cross-site requests. | 123 // Be sure to clean up any leftover state from cross-site requests. |
123 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest( | 124 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest( |
124 process()->id(), routing_id(), false); | 125 process()->id(), routing_id(), false); |
125 } | 126 } |
126 | 127 |
127 bool RenderViewHost::CreateRenderView(const string16& frame_name) { | 128 bool RenderViewHost::CreateRenderView(const string16& frame_name) { |
128 DCHECK(!IsRenderViewLive()) << "Creating view twice"; | 129 DCHECK(!IsRenderViewLive()) << "Creating view twice"; |
129 | 130 |
130 // The process may (if we're sharing a process with another host that already | 131 // The process may (if we're sharing a process with another host that already |
131 // initialized it) or may not (we have our own process or the old process | 132 // initialized it) or may not (we have our own process or the old process |
132 // crashed) have been initialized. Calling Init multiple times will be | 133 // crashed) have been initialized. Calling Init multiple times will be |
133 // ignored, so this is safe. | 134 // ignored, so this is safe. |
134 if (!process()->Init(renderer_accessible(), is_extension_process_)) | 135 if (!process()->Init(renderer_accessible(), is_extension_process_, |
| 136 installed_app_)) |
135 return false; | 137 return false; |
136 DCHECK(process()->HasConnection()); | 138 DCHECK(process()->HasConnection()); |
137 DCHECK(process()->profile()); | 139 DCHECK(process()->profile()); |
138 | 140 |
139 if (BindingsPolicy::is_web_ui_enabled(enabled_bindings_)) { | 141 if (BindingsPolicy::is_web_ui_enabled(enabled_bindings_)) { |
140 ChildProcessSecurityPolicy::GetInstance()->GrantWebUIBindings( | 142 ChildProcessSecurityPolicy::GetInstance()->GrantWebUIBindings( |
141 process()->id()); | 143 process()->id()); |
142 } | 144 } |
143 | 145 |
144 if (BindingsPolicy::is_extension_enabled(enabled_bindings_)) { | 146 if (BindingsPolicy::is_extension_enabled(enabled_bindings_)) { |
(...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1702 LOG(DFATAL) << "Invalid checked state " << checked_state; | 1704 LOG(DFATAL) << "Invalid checked state " << checked_state; |
1703 return; | 1705 return; |
1704 } | 1706 } |
1705 | 1707 |
1706 CommandState state; | 1708 CommandState state; |
1707 state.is_enabled = is_enabled; | 1709 state.is_enabled = is_enabled; |
1708 state.checked_state = | 1710 state.checked_state = |
1709 static_cast<RenderViewCommandCheckedState>(checked_state); | 1711 static_cast<RenderViewCommandCheckedState>(checked_state); |
1710 command_states_[static_cast<RenderViewCommand>(command)] = state; | 1712 command_states_[static_cast<RenderViewCommand>(command)] = state; |
1711 } | 1713 } |
OLD | NEW |