| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2010 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_WEBUI_LOGIN_LOGIN_CONTAINER_UI_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_WEBUI_LOGIN_LOGIN_CONTAINER_UI_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <string> |
| 10 |
| 11 #include "base/scoped_ptr.h" |
| 12 #include "chrome/browser/chromeos/webui/login/login_ui_helpers.h" |
| 13 #include "chrome/browser/webui/chrome_url_data_manager.h" |
| 14 #include "chrome/browser/webui/web_ui.h" |
| 15 #include "views/widget/widget.h" |
| 16 |
| 17 class Profile; |
| 18 |
| 19 namespace chromeos { |
| 20 |
| 21 class BrowserOperationsInterface; |
| 22 class ProfileOperationsInterface; |
| 23 |
| 24 // Boilerplate class that is used to associate the LoginContainerUI code with |
| 25 // the URL "chrome://login-container" |
| 26 class LoginContainerUIHTMLSource : public ChromeURLDataManager::DataSource { |
| 27 public: |
| 28 explicit LoginContainerUIHTMLSource(MessageLoop* message_loop); |
| 29 |
| 30 virtual void StartDataRequest(const std::string& path, |
| 31 bool is_off_the_record, |
| 32 int request_id); |
| 33 virtual std::string GetMimeType(const std::string&) const { |
| 34 return "text/html"; |
| 35 } |
| 36 |
| 37 private: |
| 38 scoped_ptr<HTMLOperationsInterface> html_operations_; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(LoginContainerUIHTMLSource); |
| 41 }; |
| 42 |
| 43 // Main LoginContainerUI handling function. It handles the WebUI hooks that are |
| 44 // supplied for the page to launch the login container. |
| 45 class LoginContainerUIHandler : public WebUIMessageHandler { |
| 46 public: |
| 47 LoginContainerUIHandler(); |
| 48 ~LoginContainerUIHandler(); |
| 49 |
| 50 // WebUIMessageHandler implementation. |
| 51 virtual WebUIMessageHandler* Attach(WebUI* web_ui); |
| 52 virtual void RegisterMessages(); |
| 53 |
| 54 void HandleOpenLoginScreen(const ListValue* args); |
| 55 |
| 56 private: |
| 57 scoped_ptr<BrowserOperationsInterface> browser_operations_; |
| 58 scoped_ptr<ProfileOperationsInterface> profile_operations_; |
| 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(LoginContainerUIHandler); |
| 61 }; |
| 62 |
| 63 // Boilerplate class that is used to associate the LoginContainerUI code with |
| 64 // the Webui code. |
| 65 class LoginContainerUI : public WebUI { |
| 66 public: |
| 67 explicit LoginContainerUI(TabContents* contents); |
| 68 |
| 69 // Return the URL for a given search term. |
| 70 static const GURL GetLoginURLWithSearchText(const string16& text); |
| 71 |
| 72 static RefCountedMemory* GetFaviconResourceBytes(); |
| 73 |
| 74 private: |
| 75 DISALLOW_COPY_AND_ASSIGN(LoginContainerUI); |
| 76 }; |
| 77 |
| 78 } // namespace chromeos |
| 79 |
| 80 #endif // CHROME_BROWSER_CHROMEOS_WEBUI_LOGIN_LOGIN_CONTAINER_UI_H_ |
| OLD | NEW |