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

Side by Side Diff: content/browser/renderer_host/render_view_host.cc

Issue 9203001: Implement input type=color UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed comment Created 8 years, 11 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/renderer_host/render_view_host.h" 5 #include "content/browser/renderer_host/render_view_host.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 612
613 void RenderViewHost::LostMouseLock() { 613 void RenderViewHost::LostMouseLock() {
614 RenderWidgetHost::LostMouseLock(); 614 RenderWidgetHost::LostMouseLock();
615 delegate_->LostMouseLock(); 615 delegate_->LostMouseLock();
616 } 616 }
617 617
618 void RenderViewHost::SetInitialFocus(bool reverse) { 618 void RenderViewHost::SetInitialFocus(bool reverse) {
619 Send(new ViewMsg_SetInitialFocus(routing_id(), reverse)); 619 Send(new ViewMsg_SetInitialFocus(routing_id(), reverse));
620 } 620 }
621 621
622 void RenderViewHost::DidChooseColorInColorChooser(WebKit::WebColor color) {
623 Send(new ViewMsg_DidChooseColorResponse(routing_id(), color));
624 }
625
626 void RenderViewHost::DidEndColorChooser() {
627 Send(new ViewMsg_DidEndColorChooser(routing_id()));
628 }
629
622 void RenderViewHost::FilesSelectedInChooser( 630 void RenderViewHost::FilesSelectedInChooser(
623 const std::vector<FilePath>& files, 631 const std::vector<FilePath>& files,
624 int permissions) { 632 int permissions) {
625 // Grant the security access requested to the given files. 633 // Grant the security access requested to the given files.
626 for (std::vector<FilePath>::const_iterator file = files.begin(); 634 for (std::vector<FilePath>::const_iterator file = files.begin();
627 file != files.end(); ++file) { 635 file != files.end(); ++file) {
628 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( 636 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile(
629 process()->GetID(), *file, permissions); 637 process()->GetID(), *file, permissions);
630 } 638 }
631 Send(new ViewMsg_RunFileChooserResponse(routing_id(), files)); 639 Send(new ViewMsg_RunFileChooserResponse(routing_id(), files));
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 IPC_MESSAGE_HANDLER(ViewHostMsg_MediaNotification, OnMediaNotification) 748 IPC_MESSAGE_HANDLER(ViewHostMsg_MediaNotification, OnMediaNotification)
741 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_RequestPermission, 749 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_RequestPermission,
742 OnRequestDesktopNotificationPermission) 750 OnRequestDesktopNotificationPermission)
743 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Show, 751 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Show,
744 OnShowDesktopNotification) 752 OnShowDesktopNotification)
745 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Cancel, 753 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Cancel,
746 OnCancelDesktopNotification) 754 OnCancelDesktopNotification)
747 #if defined(OS_MACOSX) 755 #if defined(OS_MACOSX)
748 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnMsgShowPopup) 756 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnMsgShowPopup)
749 #endif 757 #endif
758 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenColorChooser, OnOpenColorChooser)
jam 2012/01/27 18:13:40 there's no need to filter the message in RenderVie
keishi 2012/02/06 15:01:57 Done.
759 IPC_MESSAGE_HANDLER(ViewHostMsg_EndColorChooser, OnEndColorChooser)
760 IPC_MESSAGE_HANDLER(ViewHostMsg_SetSelectedColorInColorChooser,
761 OnSetSelectedColorInColorChooser)
750 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser) 762 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser)
751 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) 763 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend)
752 // Have the super handle all other messages. 764 // Have the super handle all other messages.
753 IPC_MESSAGE_UNHANDLED(handled = RenderWidgetHost::OnMessageReceived(msg)) 765 IPC_MESSAGE_UNHANDLED(handled = RenderWidgetHost::OnMessageReceived(msg))
754 IPC_END_MESSAGE_MAP_EX() 766 IPC_END_MESSAGE_MAP_EX()
755 767
756 if (!msg_is_ok) { 768 if (!msg_is_ok) {
757 // The message had a handler, but its de-serialization failed. 769 // The message had a handler, but its de-serialization failed.
758 // Kill the renderer. 770 // Kill the renderer.
759 content::RecordAction(UserMetricsAction("BadMessageTerminate_RVH")); 771 content::RecordAction(UserMetricsAction("BadMessageTerminate_RVH"));
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 view->ShowPopupMenu(params.bounds, 1543 view->ShowPopupMenu(params.bounds,
1532 params.item_height, 1544 params.item_height,
1533 params.item_font_size, 1545 params.item_font_size,
1534 params.selected_item, 1546 params.selected_item,
1535 params.popup_items, 1547 params.popup_items,
1536 params.right_aligned); 1548 params.right_aligned);
1537 } 1549 }
1538 } 1550 }
1539 #endif 1551 #endif
1540 1552
1553 void RenderViewHost::OnOpenColorChooser(const WebKit::WebColor& color) {
1554 delegate_->OpenColorChooser(this, color);
1555 }
1556
1557 void RenderViewHost::OnEndColorChooser() {
1558 delegate_->EndColorChooser(this);
1559 }
1560
1561 void RenderViewHost::OnSetSelectedColorInColorChooser(
1562 const WebKit::WebColor& color) {
1563 delegate_->SetSelectedColorInColorChooser(this, color);
1564 }
1565
1541 void RenderViewHost::OnRunFileChooser( 1566 void RenderViewHost::OnRunFileChooser(
1542 const content::FileChooserParams& params) { 1567 const content::FileChooserParams& params) {
1543 delegate_->RunFileChooser(this, params); 1568 delegate_->RunFileChooser(this, params);
1544 } 1569 }
1545 1570
1546 void RenderViewHost::OnWebUISend(const GURL& source_url, 1571 void RenderViewHost::OnWebUISend(const GURL& source_url,
1547 const std::string& name, 1572 const std::string& name,
1548 const base::ListValue& args) { 1573 const base::ListValue& args) {
1549 delegate_->WebUISend(this, source_url, name, args); 1574 delegate_->WebUISend(this, source_url, name, args);
1550 } 1575 }
1551 1576
1552 void RenderViewHost::ClearPowerSaveBlockers() { 1577 void RenderViewHost::ClearPowerSaveBlockers() {
1553 STLDeleteValues(&power_save_blockers_); 1578 STLDeleteValues(&power_save_blockers_);
1554 } 1579 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698