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 #include "chrome_frame/chrome_frame_npapi.h" | 5 #include "chrome_frame/chrome_frame_npapi.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 } | 875 } |
876 } | 876 } |
877 | 877 |
878 SetReadyState(READYSTATE_COMPLETE); | 878 SetReadyState(READYSTATE_COMPLETE); |
879 } | 879 } |
880 | 880 |
881 void ChromeFrameNPAPI::OnAutomationServerLaunchFailed( | 881 void ChromeFrameNPAPI::OnAutomationServerLaunchFailed( |
882 AutomationLaunchResult reason, const std::string& server_version) { | 882 AutomationLaunchResult reason, const std::string& server_version) { |
883 SetReadyState(READYSTATE_UNINITIALIZED); | 883 SetReadyState(READYSTATE_UNINITIALIZED); |
884 | 884 |
885 // Do not display warnings for privileged instances of Chrome Frame. | 885 // In IE, we don't display warnings for privileged CF instances because |
886 if (reason == AUTOMATION_VERSION_MISMATCH && !is_privileged_) { | 886 // there are 2 CFs created for each tab (so we decide on the CEEE side |
| 887 // whether to show a warning). In FF however, there is only one privileged |
| 888 // CF instance per Firefox window, so OK to show the warning there without |
| 889 // any further logic. |
| 890 if (reason == AUTOMATION_VERSION_MISMATCH) { |
887 THREAD_SAFE_UMA_HISTOGRAM_COUNTS("ChromeFrame.VersionMismatchDisplayed", 1); | 891 THREAD_SAFE_UMA_HISTOGRAM_COUNTS("ChromeFrame.VersionMismatchDisplayed", 1); |
888 DisplayVersionMismatchWarning(m_hWnd, server_version); | 892 DisplayVersionMismatchWarning(m_hWnd, server_version); |
889 } | 893 } |
890 } | 894 } |
891 | 895 |
892 void ChromeFrameNPAPI::OnCloseTab(int tab_handle) { | 896 void ChromeFrameNPAPI::OnCloseTab(int tab_handle) { |
893 std::string arg; | 897 std::string arg; |
894 FireEvent("close", arg); | 898 FireEvent("close", arg); |
895 ScopedNpVariant result; | 899 ScopedNpVariant result; |
896 InvokeDefault(onclose_handler_, arg, &result); | 900 InvokeDefault(onclose_handler_, arg, &result); |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 } | 1497 } |
1494 | 1498 |
1495 int32 ChromeFrameNPAPI::Write(NPStream* stream, int32 offset, int32 len, | 1499 int32 ChromeFrameNPAPI::Write(NPStream* stream, int32 offset, int32 len, |
1496 void* buffer) { | 1500 void* buffer) { |
1497 return url_fetcher_.Write(stream, offset, len, buffer); | 1501 return url_fetcher_.Write(stream, offset, len, buffer); |
1498 } | 1502 } |
1499 | 1503 |
1500 NPError ChromeFrameNPAPI::DestroyStream(NPStream* stream, NPReason reason) { | 1504 NPError ChromeFrameNPAPI::DestroyStream(NPStream* stream, NPReason reason) { |
1501 return url_fetcher_.DestroyStream(stream, reason); | 1505 return url_fetcher_.DestroyStream(stream, reason); |
1502 } | 1506 } |
OLD | NEW |