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

Side by Side Diff: content/browser/tab_contents/tab_contents.cc

Issue 9203001: Implement input type=color UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed issues Created 8 years, 10 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
OLDNEW
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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) 503 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset)
504 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) 504 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits)
505 IPC_MESSAGE_HANDLER(ViewHostMsg_SaveURLAs, OnSaveURL) 505 IPC_MESSAGE_HANDLER(ViewHostMsg_SaveURLAs, OnSaveURL)
506 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) 506 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory)
507 IPC_MESSAGE_HANDLER(ViewHostMsg_JSOutOfMemory, OnJSOutOfMemory) 507 IPC_MESSAGE_HANDLER(ViewHostMsg_JSOutOfMemory, OnJSOutOfMemory)
508 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, 508 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler,
509 OnRegisterProtocolHandler) 509 OnRegisterProtocolHandler)
510 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) 510 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply)
511 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin) 511 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin)
512 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) 512 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed)
513 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenColorChooser, OnOpenColorChooser)
514 IPC_MESSAGE_HANDLER(ViewHostMsg_EndColorChooser, OnEndColorChooser)
515 IPC_MESSAGE_HANDLER(ViewHostMsg_SetSelectedColorInColorChooser,
516 OnSetSelectedColorInColorChooser)
513 IPC_MESSAGE_UNHANDLED(handled = false) 517 IPC_MESSAGE_UNHANDLED(handled = false)
514 IPC_END_MESSAGE_MAP_EX() 518 IPC_END_MESSAGE_MAP_EX()
515 519
516 if (!message_is_ok) { 520 if (!message_is_ok) {
517 content::RecordAction(UserMetricsAction("BadMessageTerminate_RVD")); 521 content::RecordAction(UserMetricsAction("BadMessageTerminate_RVD"));
518 GetRenderProcessHost()->ReceivedBadMessage(); 522 GetRenderProcessHost()->ReceivedBadMessage();
519 } 523 }
520 524
521 return handled; 525 return handled;
522 } 526 }
523 527
528 void TabContents::OnOpenColorChooser(int color_chooser_id,
529 const SkColor& color) {
530 delegate_->OpenColorChooser(this, color_chooser_id, color);
531 }
532
533 void TabContents::OnEndColorChooser(int color_chooser_id) {
534 delegate_->EndColorChooser(this, color_chooser_id);
535 }
536
537 void TabContents::OnSetSelectedColorInColorChooser(
538 int color_chooser_id, const SkColor& color) {
539 delegate_->SetSelectedColorInColorChooser(this, color_chooser_id, color);
540 }
541
524 void TabContents::RunFileChooser( 542 void TabContents::RunFileChooser(
525 RenderViewHost* render_view_host, 543 RenderViewHost* render_view_host,
526 const content::FileChooserParams& params) { 544 const content::FileChooserParams& params) {
527 delegate_->RunFileChooser(this, params); 545 delegate_->RunFileChooser(this, params);
528 } 546 }
529 547
530 NavigationController& TabContents::GetController() { 548 NavigationController& TabContents::GetController() {
531 return controller_; 549 return controller_;
532 } 550 }
533 551
(...skipping 1931 matching lines...) Expand 10 before | Expand all | Expand 10 after
2465 save_info, 2483 save_info,
2466 this); 2484 this);
2467 } 2485 }
2468 2486
2469 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2487 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2470 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); 2488 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh);
2471 // Can be NULL during tests. 2489 // Can be NULL during tests.
2472 if (rwh_view) 2490 if (rwh_view)
2473 rwh_view->SetSize(GetView()->GetContainerSize()); 2491 rwh_view->SetSize(GetView()->GetContainerSize());
2474 } 2492 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698