| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/guest_view/web_view/web_view_guest.h" | 5 #include "chrome/browser/guest_view/web_view/web_view_guest.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 162 } |
| 163 *persist_storage = true; | 163 *persist_storage = true; |
| 164 } else { | 164 } else { |
| 165 *storage_partition_id = partition_str; | 165 *storage_partition_id = partition_str; |
| 166 *persist_storage = false; | 166 *persist_storage = false; |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 | 169 |
| 170 } // namespace | 170 } // namespace |
| 171 | 171 |
| 172 WebViewGuest::WebViewGuest(content::BrowserContext* browser_context, | 172 // static |
| 173 int guest_instance_id) | 173 GuestViewBase* WebViewGuest::Create(content::BrowserContext* browser_context, |
| 174 : GuestView<WebViewGuest>(browser_context, guest_instance_id), | 174 int guest_instance_id) { |
| 175 pending_context_menu_request_id_(0), | 175 return new WebViewGuest(browser_context, guest_instance_id); |
| 176 is_overriding_user_agent_(false), | |
| 177 chromevox_injected_(false), | |
| 178 current_zoom_factor_(1.0), | |
| 179 find_helper_(this), | |
| 180 javascript_dialog_helper_(this) { | |
| 181 } | 176 } |
| 182 | 177 |
| 183 // static | 178 // static |
| 184 bool WebViewGuest::GetGuestPartitionConfigForSite( | 179 bool WebViewGuest::GetGuestPartitionConfigForSite( |
| 185 const GURL& site, | 180 const GURL& site, |
| 186 std::string* partition_domain, | 181 std::string* partition_domain, |
| 187 std::string* partition_name, | 182 std::string* partition_name, |
| 188 bool* in_memory) { | 183 bool* in_memory) { |
| 189 if (!site.SchemeIs(content::kGuestScheme)) | 184 if (!site.SchemeIs(content::kGuestScheme)) |
| 190 return false; | 185 return false; |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 removal_mask, | 686 removal_mask, |
| 692 content::StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL, | 687 content::StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL, |
| 693 GURL(), | 688 GURL(), |
| 694 content::StoragePartition::OriginMatcherFunction(), | 689 content::StoragePartition::OriginMatcherFunction(), |
| 695 remove_since, | 690 remove_since, |
| 696 base::Time::Now(), | 691 base::Time::Now(), |
| 697 callback); | 692 callback); |
| 698 return true; | 693 return true; |
| 699 } | 694 } |
| 700 | 695 |
| 696 WebViewGuest::WebViewGuest(content::BrowserContext* browser_context, |
| 697 int guest_instance_id) |
| 698 : GuestView<WebViewGuest>(browser_context, guest_instance_id), |
| 699 pending_context_menu_request_id_(0), |
| 700 is_overriding_user_agent_(false), |
| 701 chromevox_injected_(false), |
| 702 current_zoom_factor_(1.0), |
| 703 find_helper_(this), |
| 704 javascript_dialog_helper_(this) { |
| 705 } |
| 706 |
| 701 WebViewGuest::~WebViewGuest() { | 707 WebViewGuest::~WebViewGuest() { |
| 702 } | 708 } |
| 703 | 709 |
| 704 void WebViewGuest::DidCommitProvisionalLoadForFrame( | 710 void WebViewGuest::DidCommitProvisionalLoadForFrame( |
| 705 content::RenderFrameHost* render_frame_host, | 711 content::RenderFrameHost* render_frame_host, |
| 706 const GURL& url, | 712 const GURL& url, |
| 707 content::PageTransition transition_type) { | 713 content::PageTransition transition_type) { |
| 708 find_helper_.CancelAllFindSessions(); | 714 find_helper_.CancelAllFindSessions(); |
| 709 | 715 |
| 710 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 716 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 bool allow, | 1244 bool allow, |
| 1239 const std::string& user_input) { | 1245 const std::string& user_input) { |
| 1240 WebViewGuest* guest = | 1246 WebViewGuest* guest = |
| 1241 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); | 1247 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); |
| 1242 if (!guest) | 1248 if (!guest) |
| 1243 return; | 1249 return; |
| 1244 | 1250 |
| 1245 if (!allow) | 1251 if (!allow) |
| 1246 guest->Destroy(); | 1252 guest->Destroy(); |
| 1247 } | 1253 } |
| OLD | NEW |