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

Side by Side Diff: Source/core/page/Page.cpp

Issue 288393002: Implement navigator.languages. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@language_change_tests
Patch Set: error 500 Created 6 years, 6 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 | « Source/core/frame/NavigatorLanguage.idl ('k') | no next file » | 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, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R ights Reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R ights Reserved.
3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 if (m_mainFrame == frame) { 528 if (m_mainFrame == frame) {
529 useCounter().didCommitLoad(); 529 useCounter().didCommitLoad();
530 m_inspectorController->didCommitLoadForMainFrame(); 530 m_inspectorController->didCommitLoadForMainFrame();
531 } 531 }
532 } 532 }
533 533
534 void Page::acceptLanguagesChanged() 534 void Page::acceptLanguagesChanged()
535 { 535 {
536 Vector< RefPtr<LocalFrame> > frames; 536 Vector< RefPtr<LocalFrame> > frames;
537 537
538 // Even though we don't fire an event from here, the DOMWindow's will fire
539 // an event so we keep the frames alive until we are done.
538 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().traverseN ext()) 540 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().traverseN ext())
539 frames.append(frame); 541 frames.append(frame);
540 542
541 for (unsigned i = 0; i < frames.size(); ++i) 543 for (unsigned i = 0; i < frames.size(); ++i)
542 frames[i]->domWindow()->dispatchEvent(Event::create(EventTypeNames::lang uagechange)); 544 frames[i]->domWindow()->acceptLanguagesChanged();
543 } 545 }
544 546
545 PageLifecycleNotifier& Page::lifecycleNotifier() 547 PageLifecycleNotifier& Page::lifecycleNotifier()
546 { 548 {
547 return static_cast<PageLifecycleNotifier&>(LifecycleContext<Page>::lifecycle Notifier()); 549 return static_cast<PageLifecycleNotifier&>(LifecycleContext<Page>::lifecycle Notifier());
548 } 550 }
549 551
550 PassOwnPtr<LifecycleNotifier<Page> > Page::createLifecycleNotifier() 552 PassOwnPtr<LifecycleNotifier<Page> > Page::createLifecycleNotifier()
551 { 553 {
552 return PageLifecycleNotifier::create(this); 554 return PageLifecycleNotifier::create(this);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 , spellCheckerClient(0) 601 , spellCheckerClient(0)
600 , storageClient(0) 602 , storageClient(0)
601 { 603 {
602 } 604 }
603 605
604 Page::PageClients::~PageClients() 606 Page::PageClients::~PageClients()
605 { 607 {
606 } 608 }
607 609
608 } // namespace WebCore 610 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/NavigatorLanguage.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698