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

Side by Side Diff: chrome_frame/chrome_frame_npapi.cc

Issue 5998006: Clean up Automation and Chrome Frame IPC code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 12 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 | Annotate | Revision Log
« no previous file with comments | « chrome_frame/chrome_frame_npapi.h ('k') | chrome_frame/chrome_frame_plugin.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 // there are 2 CFs created for each tab (so we decide on the CEEE side 894 // there are 2 CFs created for each tab (so we decide on the CEEE side
895 // whether to show a warning). In FF however, there is only one privileged 895 // whether to show a warning). In FF however, there is only one privileged
896 // CF instance per Firefox window, so OK to show the warning there without 896 // CF instance per Firefox window, so OK to show the warning there without
897 // any further logic. 897 // any further logic.
898 if (reason == AUTOMATION_VERSION_MISMATCH) { 898 if (reason == AUTOMATION_VERSION_MISMATCH) {
899 THREAD_SAFE_UMA_HISTOGRAM_COUNTS("ChromeFrame.VersionMismatchDisplayed", 1); 899 THREAD_SAFE_UMA_HISTOGRAM_COUNTS("ChromeFrame.VersionMismatchDisplayed", 1);
900 DisplayVersionMismatchWarning(m_hWnd, server_version); 900 DisplayVersionMismatchWarning(m_hWnd, server_version);
901 } 901 }
902 } 902 }
903 903
904 void ChromeFrameNPAPI::OnCloseTab(int tab_handle) { 904 void ChromeFrameNPAPI::OnCloseTab() {
905 std::string arg; 905 std::string arg;
906 FireEvent("close", arg); 906 FireEvent("close", arg);
907 ScopedNpVariant result; 907 ScopedNpVariant result;
908 InvokeDefault(onclose_handler_, arg, &result); 908 InvokeDefault(onclose_handler_, arg, &result);
909 } 909 }
910 910
911 bool ChromeFrameNPAPI::InvokeDefault(NPObject* object, 911 bool ChromeFrameNPAPI::InvokeDefault(NPObject* object,
912 unsigned param_count, 912 unsigned param_count,
913 const NPVariant* params, 913 const NPVariant* params,
914 NPVariant* result) { 914 NPVariant* result) {
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 bool ChromeFrameNPAPI::PreProcessContextMenu(HMENU menu) { 1480 bool ChromeFrameNPAPI::PreProcessContextMenu(HMENU menu) {
1481 // TODO: Remove this overridden method once HandleContextMenuCommand 1481 // TODO: Remove this overridden method once HandleContextMenuCommand
1482 // implements "About Chrome Frame" handling. 1482 // implements "About Chrome Frame" handling.
1483 if (!is_privileged()) { 1483 if (!is_privileged()) {
1484 // Call base class (adds 'About' item). 1484 // Call base class (adds 'About' item).
1485 return ChromeFramePlugin::PreProcessContextMenu(menu); 1485 return ChromeFramePlugin::PreProcessContextMenu(menu);
1486 } 1486 }
1487 return true; 1487 return true;
1488 } 1488 }
1489 1489
1490 bool ChromeFrameNPAPI::HandleContextMenuCommand(UINT cmd, 1490 bool ChromeFrameNPAPI::HandleContextMenuCommand(
1491 const IPC::MiniContextMenuParams& params) { 1491 UINT cmd, const MiniContextMenuParams& params) {
1492 if (cmd == IDC_ABOUT_CHROME_FRAME) { 1492 if (cmd == IDC_ABOUT_CHROME_FRAME) {
1493 // TODO: implement "About Chrome Frame" 1493 // TODO: implement "About Chrome Frame"
1494 } 1494 }
1495 return false; 1495 return false;
1496 } 1496 }
1497 1497
1498 NPError ChromeFrameNPAPI::NewStream(NPMIMEType type, NPStream* stream, 1498 NPError ChromeFrameNPAPI::NewStream(NPMIMEType type, NPStream* stream,
1499 NPBool seekable, uint16* stream_type) { 1499 NPBool seekable, uint16* stream_type) {
1500 return url_fetcher_.NewStream(type, stream, seekable, stream_type); 1500 return url_fetcher_.NewStream(type, stream, seekable, stream_type);
1501 } 1501 }
1502 1502
1503 int32 ChromeFrameNPAPI::WriteReady(NPStream* stream) { 1503 int32 ChromeFrameNPAPI::WriteReady(NPStream* stream) {
1504 return url_fetcher_.WriteReady(stream); 1504 return url_fetcher_.WriteReady(stream);
1505 } 1505 }
1506 1506
1507 int32 ChromeFrameNPAPI::Write(NPStream* stream, int32 offset, int32 len, 1507 int32 ChromeFrameNPAPI::Write(NPStream* stream, int32 offset, int32 len,
1508 void* buffer) { 1508 void* buffer) {
1509 return url_fetcher_.Write(stream, offset, len, buffer); 1509 return url_fetcher_.Write(stream, offset, len, buffer);
1510 } 1510 }
1511 1511
1512 NPError ChromeFrameNPAPI::DestroyStream(NPStream* stream, NPReason reason) { 1512 NPError ChromeFrameNPAPI::DestroyStream(NPStream* stream, NPReason reason) {
1513 return url_fetcher_.DestroyStream(stream, reason); 1513 return url_fetcher_.DestroyStream(stream, reason);
1514 } 1514 }
OLDNEW
« no previous file with comments | « chrome_frame/chrome_frame_npapi.h ('k') | chrome_frame/chrome_frame_plugin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698