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