Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: src/plugin/PluginClass.cpp

Issue 5137721374801920: Issue #1173 - Default behavior for catch-all blocks
Left Patch Set: rebase + nit Created March 20, 2015, 9:36 a.m.
Right Patch Set: Changed entry point defaults in CPluginClass to match rebase Created March 20, 2015, 9:50 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/plugin/Exception.h ('k') | src/plugin/PluginDebug.h » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus 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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 UpdateStatusBar(); 536 UpdateStatusBar();
537 } 537 }
538 else 538 else
539 { 539 {
540 DEBUG_NAVI(L"Navi::Begin navigation url:" + url) 540 DEBUG_NAVI(L"Navi::Begin navigation url:" + url)
541 m_tab->CacheFrame(url); 541 m_tab->CacheFrame(url);
542 } 542 }
543 } 543 }
544 catch (...) 544 catch (...)
545 { 545 {
546 EntryPointExceptionDefault("CPluginClass::OnBeforeNavigate2");
546 } 547 }
547 } 548 }
548 549
549 // Entry point 550 // Entry point
550 void STDMETHODCALLTYPE CPluginClass::OnDownloadComplete() 551 void STDMETHODCALLTYPE CPluginClass::OnDownloadComplete()
551 { 552 {
552 try 553 try
553 { 554 {
554 DEBUG_NAVI(L"Navi::Download Complete") 555 DEBUG_NAVI(L"Navi::Download Complete")
555 ATL::CComPtr<IWebBrowser2> browser = GetBrowser(); 556 ATL::CComPtr<IWebBrowser2> browser = GetBrowser();
556 if (browser) 557 if (browser)
557 { 558 {
558 m_tab->OnDownloadComplete(browser); 559 m_tab->OnDownloadComplete(browser);
559 } 560 }
560 } 561 }
561 catch (...) 562 catch (...)
562 { 563 {
564 EntryPointExceptionDefault("CPluginClass::OnDownloadComplete");
563 } 565 }
564 } 566 }
565 567
566 // Entry point 568 // Entry point
567 void STDMETHODCALLTYPE CPluginClass::OnDocumentComplete(IDispatch* frameBrowserD isp, VARIANT* /*urlOrPidl*/) 569 void STDMETHODCALLTYPE CPluginClass::OnDocumentComplete(IDispatch* frameBrowserD isp, VARIANT* /*urlOrPidl*/)
568 { 570 {
569 try 571 try
570 { 572 {
571 DEBUG_NAVI(L"Navi::Document Complete"); 573 DEBUG_NAVI(L"Navi::Document Complete");
572 ATL::CComQIPtr<IWebBrowser2> webBrowser2 = frameBrowserDisp; 574 ATL::CComQIPtr<IWebBrowser2> webBrowser2 = frameBrowserDisp;
573 if (!webBrowser2) 575 if (!webBrowser2)
574 { 576 {
575 return; 577 return;
576 } 578 }
577 std::wstring frameSrc = GetLocationUrl(*webBrowser2); 579 std::wstring frameSrc = GetLocationUrl(*webBrowser2);
578 UnescapeUrl(frameSrc); 580 UnescapeUrl(frameSrc);
579 bool isRootPageBrowser = GetBrowser().IsEqualObject(webBrowser2); 581 bool isRootPageBrowser = GetBrowser().IsEqualObject(webBrowser2);
580 m_tab->OnDocumentComplete(webBrowser2, frameSrc, isRootPageBrowser); 582 m_tab->OnDocumentComplete(webBrowser2, frameSrc, isRootPageBrowser);
581 } 583 }
582 catch (...) 584 catch (...)
583 { 585 {
586 EntryPointExceptionDefault("CPluginClass::OnDocumentComplete");
584 } 587 }
585 } 588 }
586 589
587 // Entry point 590 // Entry point
588 void STDMETHODCALLTYPE CPluginClass::OnWindowStateChanged(unsigned long flags, u nsigned long validFlagsMask) 591 void STDMETHODCALLTYPE CPluginClass::OnWindowStateChanged(unsigned long flags, u nsigned long validFlagsMask)
589 { 592 {
590 try 593 try
591 { 594 {
592 DEBUG_GENERAL(L"WindowStateChanged (check tab changed)"); 595 DEBUG_GENERAL(L"WindowStateChanged (check tab changed)");
593 bool newtabshown = validFlagsMask == (OLECMDIDF_WINDOWSTATE_USERVISIBLE | OL ECMDIDF_WINDOWSTATE_ENABLED) 596 bool newtabshown = validFlagsMask == (OLECMDIDF_WINDOWSTATE_USERVISIBLE | OL ECMDIDF_WINDOWSTATE_ENABLED)
(...skipping 10 matching lines...) Expand all
604 InitObject(true); 607 InitObject(true);
605 UpdateStatusBar(); 608 UpdateStatusBar();
606 } 609 }
607 } 610 }
608 } 611 }
609 notificationMessage.Hide(); 612 notificationMessage.Hide();
610 DEBUG_GENERAL(L"WindowStateChanged (check tab changed) end"); 613 DEBUG_GENERAL(L"WindowStateChanged (check tab changed) end");
611 } 614 }
612 catch (...) 615 catch (...)
613 { 616 {
617 EntryPointExceptionDefault("CPluginClass::OnWindowStateChanged");
614 } 618 }
615 } 619 }
616 620
617 // Entry point 621 // Entry point
618 void STDMETHODCALLTYPE CPluginClass::OnCommandStateChange(long /*command*/, VARI ANT_BOOL /*enable*/) 622 void STDMETHODCALLTYPE CPluginClass::OnCommandStateChange(long /*command*/, VARI ANT_BOOL /*enable*/)
619 { 623 {
620 try 624 try
621 { 625 {
622 if (m_hPaneWnd == NULL) 626 if (m_hPaneWnd == NULL)
623 { 627 {
624 CreateStatusBarPane(); 628 CreateStatusBarPane();
625 } 629 }
626 else 630 else
627 { 631 {
628 if (AdblockPlus::IE::InstalledMajorVersion() > 6) 632 if (AdblockPlus::IE::InstalledMajorVersion() > 6)
629 { 633 {
630 RECT rect; 634 RECT rect;
631 //Get the RECT for the leftmost pane (the status text pane) 635 //Get the RECT for the leftmost pane (the status text pane)
632 BOOL rectRes = ::SendMessage(m_hStatusBarWnd, SB_GETRECT, 0, (LPARAM)&re ct); 636 BOOL rectRes = ::SendMessage(m_hStatusBarWnd, SB_GETRECT, 0, (LPARAM)&re ct);
633 if (rectRes == TRUE) 637 if (rectRes == TRUE)
634 { 638 {
635 MoveWindow(m_hPaneWnd, rect.right - m_nPaneWidth, 0, m_nPaneWidth, rec t.bottom - rect.top, TRUE); 639 MoveWindow(m_hPaneWnd, rect.right - m_nPaneWidth, 0, m_nPaneWidth, rec t.bottom - rect.top, TRUE);
636 } 640 }
637 } 641 }
638 } 642 }
639 } 643 }
640 catch (...) 644 catch (...)
641 { 645 {
646 EntryPointExceptionDefault("CPluginClass::OnCommandStateChange");
642 } 647 }
643 } 648 }
644 649
645 // Entry point 650 // Entry point
646 void STDMETHODCALLTYPE CPluginClass::OnOnQuit() 651 void STDMETHODCALLTYPE CPluginClass::OnOnQuit()
647 { 652 {
648 try 653 try
649 { 654 {
650 Unadvise(); 655 Unadvise();
651 } 656 }
652 catch (...) 657 catch (...)
653 { 658 {
654 EntryPointExceptionDefault("CPluginClass::Invoke"); 659 EntryPointExceptionDefault("CPluginClass::OnOnQuit");
655
656 } 660 }
657 } 661 }
658 662
659 bool CPluginClass::InitObject(bool bBHO) 663 bool CPluginClass::InitObject(bool bBHO)
660 { 664 {
661 DEBUG_GENERAL("InitObject"); 665 DEBUG_GENERAL("InitObject");
662 CPluginSettings* settings = CPluginSettings::GetInstance(); 666 CPluginSettings* settings = CPluginSettings::GetInstance();
663 667
664 if (!settings->GetPluginEnabled()) 668 if (!settings->GetPluginEnabled())
665 { 669 {
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1760 s_criticalSectionLocal.Unlock(); 1764 s_criticalSectionLocal.Unlock();
1761 1765
1762 } 1766 }
1763 } 1767 }
1764 } 1768 }
1765 1769
1766 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); 1770 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT);
1767 } 1771 }
1768 return hTabWnd; 1772 return hTabWnd;
1769 } 1773 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld