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 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_CHROMEOS_ENROLLMENT_DIALOG_VIEW_H_ 6 #define CHROME_BROWSER_CHROMEOS_ENROLLMENT_DIALOG_VIEW_H_ 7 8 #include <string> 9 #include <vector> 10 11 #include "base/callback_forward.h" 12 #include "ui/gfx/native_widget_types.h" 13 14 class Profile; 15 16 namespace chromeos { 17 18 // An interface that can be used to handle certificate enrollment URIs when 19 // encountered. Also used by unit tests to avoid opening browser windows 20 // when testing. 21 class EnrollmentDelegate { 22 public: 23 EnrollmentDelegate() {} 24 virtual ~EnrollmentDelegate() {} 25 26 // Implemented to handle a given certificate enrollment URI. Returns false 27 // if the enrollment URI doesn't use a scheme that we can handle. 28 // |post_action| is called when enrollment completes. 29 virtual bool Enroll(const std::vector<std::string>& uri_list, 30 const base::Closure& post_action) = 0; 31 private: 32 DISALLOW_COPY_AND_ASSIGN(EnrollmentDelegate); 33 }; 34 35 EnrollmentDelegate* CreateEnrollmentDelegate(gfx::NativeWindow owning_window, 36 const std::string& network_name, 37 Profile* profile); 38 39 } // namespace chromeos 40 41 #endif // CHROME_BROWSER_CHROMEOS_ENROLLMENT_DIALOG_VIEW_H_ 42