OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/webui/copresence_ui.h" | 5 #include "chrome/browser/ui/webui/copresence_ui.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "chrome/browser/ui/webui/copresence_ui_handler.h" | 8 #include "chrome/browser/ui/webui/copresence_ui_handler.h" |
9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 data_source->AddLocalizedString("clear_state", | 46 data_source->AddLocalizedString("clear_state", |
47 IDS_COPRESENCE_CLEAR_STATE); | 47 IDS_COPRESENCE_CLEAR_STATE); |
48 data_source->AddLocalizedString("confirm_delete", | 48 data_source->AddLocalizedString("confirm_delete", |
49 IDS_COPRESENCE_CONFIRM_DELETE); | 49 IDS_COPRESENCE_CONFIRM_DELETE); |
50 | 50 |
51 data_source->SetJsonPath("strings.js"); | 51 data_source->SetJsonPath("strings.js"); |
52 data_source->AddResourcePath("copresence.css", IDR_COPRESENCE_CSS); | 52 data_source->AddResourcePath("copresence.css", IDR_COPRESENCE_CSS); |
53 data_source->AddResourcePath("copresence.js", IDR_COPRESENCE_JS); | 53 data_source->AddResourcePath("copresence.js", IDR_COPRESENCE_JS); |
54 data_source->SetDefaultResource(IDR_COPRESENCE_HTML); | 54 data_source->SetDefaultResource(IDR_COPRESENCE_HTML); |
55 | 55 |
56 return data_source.Pass(); | 56 return data_source; |
57 } | 57 } |
58 | 58 |
59 } // namespace | 59 } // namespace |
60 | 60 |
61 CopresenceUI::CopresenceUI(content::WebUI* web_ui) | 61 CopresenceUI::CopresenceUI(content::WebUI* web_ui) |
62 : content::WebUIController(web_ui) { | 62 : content::WebUIController(web_ui) { |
63 // This call takes ownership of the WebUIMessageHandler. | 63 // This call takes ownership of the WebUIMessageHandler. |
64 web_ui->AddMessageHandler(new CopresenceUIHandler(web_ui)); | 64 web_ui->AddMessageHandler(new CopresenceUIHandler(web_ui)); |
65 | 65 |
66 // This call takes ownership of the WebUIDataSource. | 66 // This call takes ownership of the WebUIDataSource. |
67 WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), | 67 WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), |
68 CreateDataSource().release()); | 68 CreateDataSource().release()); |
69 } | 69 } |
70 | 70 |
71 CopresenceUI::~CopresenceUI() {} | 71 CopresenceUI::~CopresenceUI() {} |
OLD | NEW |