Home | History | Annotate | Download | only in signin
      1 // Copyright 2013 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "chrome/browser/signin/principals_message_filter.h"
      6 
      7 #include "chrome/common/render_messages.h"
      8 #include "content/public/browser/browser_thread.h"
      9 
     10 PrincipalsMessageFilter::PrincipalsMessageFilter(int render_process_id)
     11     : BrowserMessageFilter(ChromeMsgStart),
     12       render_process_id_(render_process_id) {}
     13 
     14 PrincipalsMessageFilter::~PrincipalsMessageFilter(){}
     15 
     16 void PrincipalsMessageFilter::OverrideThreadForMessage(
     17       const IPC::Message& message,
     18       content::BrowserThread::ID* thread) {
     19   // GetManagedAccounts message is synchronous, it must be handled in the IO
     20   // thread, so no need to change thread, otherwise switch to UI thread
     21   if (message.type() == ChromeViewHostMsg_ShowBrowserAccountManagementUI::ID)
     22     *thread = content::BrowserThread::UI;
     23 }
     24 
     25 bool PrincipalsMessageFilter::OnMessageReceived(const IPC::Message& message) {
     26  bool handled = true;
     27  IPC_BEGIN_MESSAGE_MAP(PrincipalsMessageFilter, message)
     28      IPC_MESSAGE_HANDLER(
     29          ChromeViewHostMsg_GetManagedAccounts, OnMsgGetManagedAccounts)
     30      IPC_MESSAGE_HANDLER(
     31          ChromeViewHostMsg_ShowBrowserAccountManagementUI,
     32          OnMsgShowBrowserAccountManagementUI)
     33      IPC_MESSAGE_UNHANDLED(handled = false)
     34  IPC_END_MESSAGE_MAP()
     35  return handled;
     36 }
     37 
     38 
     39 
     40 void PrincipalsMessageFilter::OnMsgShowBrowserAccountManagementUI(){
     41   // TODO(guohui)
     42 }
     43 
     44 void PrincipalsMessageFilter::OnMsgGetManagedAccounts(
     45     const GURL& url, std::vector<std::string>* managed_accounts) {
     46   // TODO(guohui)
     47 }
     48 
     49