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

Side by Side Diff: chrome/browser/ui/tab_contents/tab_contents_wrapper.cc

Issue 7624012: First pass on intents options UI. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 4 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser/ui/tab_contents/tab_contents_wrapper.h" 5 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 } 414 }
415 415
416 bool TabContentsWrapper::OnMessageReceived(const IPC::Message& message) { 416 bool TabContentsWrapper::OnMessageReceived(const IPC::Message& message) {
417 bool handled = true; 417 bool handled = true;
418 IPC_BEGIN_MESSAGE_MAP(TabContentsWrapper, message) 418 IPC_BEGIN_MESSAGE_MAP(TabContentsWrapper, message)
419 IPC_MESSAGE_HANDLER(ViewHostMsg_JSOutOfMemory, OnJSOutOfMemory) 419 IPC_MESSAGE_HANDLER(ViewHostMsg_JSOutOfMemory, OnJSOutOfMemory)
420 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, 420 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler,
421 OnRegisterProtocolHandler) 421 OnRegisterProtocolHandler)
422 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterIntentHandler, 422 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterIntentHandler,
423 OnRegisterIntentHandler) 423 OnRegisterIntentHandler)
424 IPC_MESSAGE_HANDLER(ViewHostMsg_WebIntentDispatch,
425 OnWebIntentDispatch)
424 IPC_MESSAGE_HANDLER(ViewHostMsg_Snapshot, OnSnapshot) 426 IPC_MESSAGE_HANDLER(ViewHostMsg_Snapshot, OnSnapshot)
425 IPC_MESSAGE_HANDLER(ViewHostMsg_PDFHasUnsupportedFeature, 427 IPC_MESSAGE_HANDLER(ViewHostMsg_PDFHasUnsupportedFeature,
426 OnPDFHasUnsupportedFeature) 428 OnPDFHasUnsupportedFeature)
427 IPC_MESSAGE_HANDLER(ViewHostMsg_DidBlockDisplayingInsecureContent, 429 IPC_MESSAGE_HANDLER(ViewHostMsg_DidBlockDisplayingInsecureContent,
428 OnDidBlockDisplayingInsecureContent) 430 OnDidBlockDisplayingInsecureContent)
429 IPC_MESSAGE_HANDLER(ViewHostMsg_DidBlockRunningInsecureContent, 431 IPC_MESSAGE_HANDLER(ViewHostMsg_DidBlockRunningInsecureContent,
430 OnDidBlockRunningInsecureContent) 432 OnDidBlockRunningInsecureContent)
431 IPC_MESSAGE_UNHANDLED(handled = false) 433 IPC_MESSAGE_UNHANDLED(handled = false)
432 IPC_END_MESSAGE_MAP() 434 IPC_END_MESSAGE_MAP()
433 return handled; 435 return handled;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 } 616 }
615 617
616 WebIntentData intent; 618 WebIntentData intent;
617 intent.service_url = service_url; 619 intent.service_url = service_url;
618 intent.action = action; 620 intent.action = action;
619 intent.type = type; 621 intent.type = type;
620 intent.title = title; 622 intent.title = title;
621 AddInfoBar(new RegisterIntentHandlerInfoBarDelegate(tab_contents(), intent)); 623 AddInfoBar(new RegisterIntentHandlerInfoBarDelegate(tab_contents(), intent));
622 } 624 }
623 625
626 void TabContentsWrapper::OnWebIntentDispatch(int routing_id,
627 const string16& action,
628 const string16& type,
629 const string16& data,
630 int intent_id) {
631 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents))
632 return;
633
634 LOG(INFO) << "Browser tab contents received intent:"
635 << "\naction=" << UTF16ToASCII(action)
636 << "\ntype=" << UTF16ToASCII(type)
637 << "\ndata=" << UTF16ToUTF8(data)
638 << "\nrenderer_id=" << routing_id
639 << "\nid=" << intent_id;
640 }
641
624 void TabContentsWrapper::OnSnapshot(const SkBitmap& bitmap) { 642 void TabContentsWrapper::OnSnapshot(const SkBitmap& bitmap) {
625 NotificationService::current()->Notify( 643 NotificationService::current()->Notify(
626 chrome::NOTIFICATION_TAB_SNAPSHOT_TAKEN, 644 chrome::NOTIFICATION_TAB_SNAPSHOT_TAKEN,
627 Source<TabContentsWrapper>(this), 645 Source<TabContentsWrapper>(this),
628 Details<const SkBitmap>(&bitmap)); 646 Details<const SkBitmap>(&bitmap));
629 } 647 }
630 648
631 void TabContentsWrapper::OnPDFHasUnsupportedFeature() { 649 void TabContentsWrapper::OnPDFHasUnsupportedFeature() {
632 PDFHasUnsupportedFeature(this); 650 PDFHasUnsupportedFeature(this);
633 } 651 }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 if (infobars_.empty()) { 753 if (infobars_.empty()) {
736 registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, 754 registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED,
737 Source<NavigationController>(&tab_contents_->controller())); 755 Source<NavigationController>(&tab_contents_->controller()));
738 } 756 }
739 } 757 }
740 758
741 void TabContentsWrapper::RemoveAllInfoBars(bool animate) { 759 void TabContentsWrapper::RemoveAllInfoBars(bool animate) {
742 while (!infobars_.empty()) 760 while (!infobars_.empty())
743 RemoveInfoBarInternal(GetInfoBarDelegateAt(infobar_count() - 1), animate); 761 RemoveInfoBarInternal(GetInfoBarDelegateAt(infobar_count() - 1), animate);
744 } 762 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698