OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Implementation of ChromeActiveDocument | 5 // Implementation of ChromeActiveDocument |
6 #include "chrome_frame/chrome_active_document.h" | 6 #include "chrome_frame/chrome_active_document.h" |
7 | 7 |
8 #include <hlink.h> | 8 #include <hlink.h> |
9 #include <htiface.h> | 9 #include <htiface.h> |
10 #include <initguid.h> | 10 #include <initguid.h> |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 return HRESULT_FROM_WIN32(ERROR_NO_MORE_ITEMS); | 494 return HRESULT_FROM_WIN32(ERROR_NO_MORE_ITEMS); |
495 | 495 |
496 *url = SysAllocString(next_privacy_record_->first.c_str()); | 496 *url = SysAllocString(next_privacy_record_->first.c_str()); |
497 *policy = SysAllocString(next_privacy_record_->second.policy_ref.c_str()); | 497 *policy = SysAllocString(next_privacy_record_->second.policy_ref.c_str()); |
498 *flags = next_privacy_record_->second.flags; | 498 *flags = next_privacy_record_->second.flags; |
499 | 499 |
500 next_privacy_record_++; | 500 next_privacy_record_++; |
501 return S_OK; | 501 return S_OK; |
502 } | 502 } |
503 | 503 |
| 504 bool ChromeActiveDocument::IsSchemeAllowed(const GURL& url) { |
| 505 bool allowed = BaseActiveX::IsSchemeAllowed(url); |
| 506 if (allowed) |
| 507 return true; |
| 508 |
| 509 if (url.SchemeIs(chrome::kAboutScheme)) { |
| 510 if (LowerCaseEqualsASCII(url.spec(), chrome::kAboutPluginsURL)) |
| 511 return true; |
| 512 } |
| 513 return false; |
| 514 } |
| 515 |
504 HRESULT ChromeActiveDocument::GetInPlaceFrame( | 516 HRESULT ChromeActiveDocument::GetInPlaceFrame( |
505 IOleInPlaceFrame** in_place_frame) { | 517 IOleInPlaceFrame** in_place_frame) { |
506 DCHECK(in_place_frame); | 518 DCHECK(in_place_frame); |
507 if (in_place_frame_) { | 519 if (in_place_frame_) { |
508 *in_place_frame = in_place_frame_.get(); | 520 *in_place_frame = in_place_frame_.get(); |
509 (*in_place_frame)->AddRef(); | 521 (*in_place_frame)->AddRef(); |
510 return S_OK; | 522 return S_OK; |
511 } else { | 523 } else { |
512 return S_FALSE; | 524 return S_FALSE; |
513 } | 525 } |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 } | 1037 } |
1026 } | 1038 } |
1027 | 1039 |
1028 url_.Allocate(UTF8ToWide(cf_url.gurl().spec()).c_str()); | 1040 url_.Allocate(UTF8ToWide(cf_url.gurl().spec()).c_str()); |
1029 if (cf_url.attach_to_external_tab()) { | 1041 if (cf_url.attach_to_external_tab()) { |
1030 dimensions_ = cf_url.dimensions(); | 1042 dimensions_ = cf_url.dimensions(); |
1031 automation_client_->AttachExternalTab(cf_url.cookie()); | 1043 automation_client_->AttachExternalTab(cf_url.cookie()); |
1032 SetWindowDimensions(); | 1044 SetWindowDimensions(); |
1033 } else if (!automation_client_->InitiateNavigation(cf_url.gurl().spec(), | 1045 } else if (!automation_client_->InitiateNavigation(cf_url.gurl().spec(), |
1034 referrer, | 1046 referrer, |
1035 is_privileged_)) { | 1047 this)) { |
1036 DLOG(ERROR) << "Invalid URL: " << url_; | 1048 DLOG(ERROR) << "Invalid URL: " << url_; |
1037 Error(L"Invalid URL"); | 1049 Error(L"Invalid URL"); |
1038 url_.Reset(); | 1050 url_.Reset(); |
1039 return false; | 1051 return false; |
1040 } | 1052 } |
1041 | 1053 |
1042 if (is_automation_client_reused_) | 1054 if (is_automation_client_reused_) |
1043 return true; | 1055 return true; |
1044 | 1056 |
1045 automation_client_->SetUrlFetcher(url_fetcher_.get()); | 1057 automation_client_->SetUrlFetcher(url_fetcher_.get()); |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1374 return true; | 1386 return true; |
1375 | 1387 |
1376 if (new_navigation_info.url != navigation_info_.url) | 1388 if (new_navigation_info.url != navigation_info_.url) |
1377 return true; | 1389 return true; |
1378 | 1390 |
1379 if (new_navigation_info.referrer != navigation_info_.referrer) | 1391 if (new_navigation_info.referrer != navigation_info_.referrer) |
1380 return true; | 1392 return true; |
1381 | 1393 |
1382 return false; | 1394 return false; |
1383 } | 1395 } |
OLD | NEW |