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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 NavigationManager* mgr = NavigationManager::GetThreadInstance(); | 243 NavigationManager* mgr = NavigationManager::GetThreadInstance(); |
244 DLOG_IF(ERROR, !mgr) << "Couldn't get instance of NavigationManager"; | 244 DLOG_IF(ERROR, !mgr) << "Couldn't get instance of NavigationManager"; |
245 | 245 |
246 std::wstring url; | 246 std::wstring url; |
247 | 247 |
248 ScopedComPtr<BindContextInfo> info; | 248 ScopedComPtr<BindContextInfo> info; |
249 BindContextInfo::FromBindContext(bind_context, info.Receive()); | 249 BindContextInfo::FromBindContext(bind_context, info.Receive()); |
250 DCHECK(info); | 250 DCHECK(info); |
251 if (info && !info->GetUrl().empty()) { | 251 if (info && !info->GetUrl().empty()) { |
252 url = info->GetUrl(); | 252 url = info->GetUrl(); |
| 253 if (mgr) { |
| 254 // If the original URL contains an anchor, then the URL queried |
| 255 // from the protocol sink wrapper does not contain the anchor. To |
| 256 // workaround this we retrieve the anchor from the navigation manager |
| 257 // and append it to the url retrieved from the protocol sink wrapper. |
| 258 GURL url_for_anchor(mgr->url()); |
| 259 if (url_for_anchor.has_ref()) { |
| 260 url += L"#"; |
| 261 url += UTF8ToWide(url_for_anchor.ref()); |
| 262 } |
| 263 } |
253 } else { | 264 } else { |
254 // If the original URL contains an anchor, then the URL queried | 265 // If the original URL contains an anchor, then the URL queried |
255 // from the moniker does not contain the anchor. To workaround | 266 // from the moniker does not contain the anchor. To workaround |
256 // this we retrieve the URL from our BHO. | 267 // this we retrieve the URL from our BHO. |
257 url = GetActualUrlFromMoniker(moniker_name, bind_context, | 268 url = GetActualUrlFromMoniker(moniker_name, bind_context, |
258 mgr ? mgr->url(): std::wstring()); | 269 mgr ? mgr->url(): std::wstring()); |
259 } | 270 } |
260 | 271 |
261 ChromeFrameUrl cf_url; | 272 ChromeFrameUrl cf_url; |
262 if (!cf_url.Parse(url)) { | 273 if (!cf_url.Parse(url)) { |
(...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1398 return true; | 1409 return true; |
1399 | 1410 |
1400 if (new_navigation_info.url != navigation_info_->url) | 1411 if (new_navigation_info.url != navigation_info_->url) |
1401 return true; | 1412 return true; |
1402 | 1413 |
1403 if (new_navigation_info.referrer != navigation_info_->referrer) | 1414 if (new_navigation_info.referrer != navigation_info_->referrer) |
1404 return true; | 1415 return true; |
1405 | 1416 |
1406 return false; | 1417 return false; |
1407 } | 1418 } |
OLD | NEW |