| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) | 495 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) |
| 496 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) | 496 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) |
| 497 IPC_MESSAGE_HANDLER(ViewHostMsg_SaveURLAs, OnSaveURL) | 497 IPC_MESSAGE_HANDLER(ViewHostMsg_SaveURLAs, OnSaveURL) |
| 498 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) | 498 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) |
| 499 IPC_MESSAGE_HANDLER(ViewHostMsg_JSOutOfMemory, OnJSOutOfMemory) | 499 IPC_MESSAGE_HANDLER(ViewHostMsg_JSOutOfMemory, OnJSOutOfMemory) |
| 500 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, | 500 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, |
| 501 OnRegisterProtocolHandler) | 501 OnRegisterProtocolHandler) |
| 502 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) | 502 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) |
| 503 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin) | 503 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin) |
| 504 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) | 504 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) |
| 505 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenColorChooser, OnOpenColorChooser) |
| 506 IPC_MESSAGE_HANDLER(ViewHostMsg_EndColorChooser, OnEndColorChooser) |
| 507 IPC_MESSAGE_HANDLER(ViewHostMsg_SetSelectedColorInColorChooser, |
| 508 OnSetSelectedColorInColorChooser) |
| 505 IPC_MESSAGE_UNHANDLED(handled = false) | 509 IPC_MESSAGE_UNHANDLED(handled = false) |
| 506 IPC_END_MESSAGE_MAP_EX() | 510 IPC_END_MESSAGE_MAP_EX() |
| 507 | 511 |
| 508 if (!message_is_ok) { | 512 if (!message_is_ok) { |
| 509 content::RecordAction(UserMetricsAction("BadMessageTerminate_RVD")); | 513 content::RecordAction(UserMetricsAction("BadMessageTerminate_RVD")); |
| 510 GetRenderProcessHost()->ReceivedBadMessage(); | 514 GetRenderProcessHost()->ReceivedBadMessage(); |
| 511 } | 515 } |
| 512 | 516 |
| 513 return handled; | 517 return handled; |
| 514 } | 518 } |
| 515 | 519 |
| 520 void TabContents::OnOpenColorChooser(unsigned color_chooser_id, |
| 521 const SkColor& color) { |
| 522 delegate_->OpenColorChooser(this, color_chooser_id, color); |
| 523 } |
| 524 |
| 525 void TabContents::OnEndColorChooser(unsigned color_chooser_id) { |
| 526 delegate_->EndColorChooser(this); |
| 527 } |
| 528 |
| 529 void TabContents::OnSetSelectedColorInColorChooser( |
| 530 unsigned color_chooser_id, const SkColor& color) { |
| 531 delegate_->SetSelectedColorInColorChooser(this, color_chooser_id, color); |
| 532 } |
| 533 |
| 534 void TabContents::DidEndColorChooser() { |
| 535 delegate_->DidEndColorChooser(this); |
| 536 } |
| 537 |
| 516 void TabContents::RunFileChooser( | 538 void TabContents::RunFileChooser( |
| 517 RenderViewHost* render_view_host, | 539 RenderViewHost* render_view_host, |
| 518 const content::FileChooserParams& params) { | 540 const content::FileChooserParams& params) { |
| 519 delegate_->RunFileChooser(this, params); | 541 delegate_->RunFileChooser(this, params); |
| 520 } | 542 } |
| 521 | 543 |
| 522 NavigationController& TabContents::GetController() { | 544 NavigationController& TabContents::GetController() { |
| 523 return controller_; | 545 return controller_; |
| 524 } | 546 } |
| 525 | 547 |
| (...skipping 1907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2433 save_info, | 2455 save_info, |
| 2434 this); | 2456 this); |
| 2435 } | 2457 } |
| 2436 | 2458 |
| 2437 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2459 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2438 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2460 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
| 2439 // Can be NULL during tests. | 2461 // Can be NULL during tests. |
| 2440 if (rwh_view) | 2462 if (rwh_view) |
| 2441 rwh_view->SetSize(GetView()->GetContainerSize()); | 2463 rwh_view->SetSize(GetView()->GetContainerSize()); |
| 2442 } | 2464 } |
| OLD | NEW |