Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: sky/engine/core/frame/LocalDOMWindow.cpp

Issue 1059743004: Teach window.location.href setter to handle relative urls. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | sky/examples/raw/touch-demo.sky » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 } 696 }
697 697
698 void LocalDOMWindow::setLocation(const String& urlString, SetLocationLocking loc king) 698 void LocalDOMWindow::setLocation(const String& urlString, SetLocationLocking loc king)
699 { 699 {
700 if (!m_frame) 700 if (!m_frame)
701 return; 701 return;
702 FrameHost* host = m_frame->host(); 702 FrameHost* host = m_frame->host();
703 if (!host) 703 if (!host)
704 return; 704 return;
705 mojo::URLRequestPtr request = mojo::URLRequest::New(); 705 mojo::URLRequestPtr request = mojo::URLRequest::New();
706 request->url = urlString.toUTF8(); 706 request->url = document()->completeURL(urlString).string().toUTF8();
707 host->services()->NavigatorHost()->RequestNavigate( 707 host->services()->NavigatorHost()->RequestNavigate(
708 mojo::TARGET_SOURCE_NODE, request.Pass()); 708 mojo::TARGET_SOURCE_NODE, request.Pass());
709 } 709 }
710 710
711 void LocalDOMWindow::printErrorMessage(const String& message) 711 void LocalDOMWindow::printErrorMessage(const String& message)
712 { 712 {
713 if (message.isEmpty()) 713 if (message.isEmpty())
714 return; 714 return;
715 715
716 frameConsole()->addMessage(ConsoleMessage::create(JSMessageSource, ErrorMess ageLevel, message)); 716 frameConsole()->addMessage(ConsoleMessage::create(JSMessageSource, ErrorMess ageLevel, message));
(...skipping 10 matching lines...) Expand all
727 { 727 {
728 return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext<LocalDOMWin dow>::lifecycleNotifier()); 728 return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext<LocalDOMWin dow>::lifecycleNotifier());
729 } 729 }
730 730
731 PassOwnPtr<LifecycleNotifier<LocalDOMWindow> > LocalDOMWindow::createLifecycleNo tifier() 731 PassOwnPtr<LifecycleNotifier<LocalDOMWindow> > LocalDOMWindow::createLifecycleNo tifier()
732 { 732 {
733 return DOMWindowLifecycleNotifier::create(this); 733 return DOMWindowLifecycleNotifier::create(this);
734 } 734 }
735 735
736 } // namespace blink 736 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | sky/examples/raw/touch-demo.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698