OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/nacl_ui.h" | 5 #include "chrome/browser/ui/webui/nacl_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // | 68 // |
69 //////////////////////////////////////////////////////////////////////////////// | 69 //////////////////////////////////////////////////////////////////////////////// |
70 | 70 |
71 // The handler for JavaScript messages for the about:flags page. | 71 // The handler for JavaScript messages for the about:flags page. |
72 class NaClDomHandler : public WebUIMessageHandler { | 72 class NaClDomHandler : public WebUIMessageHandler { |
73 public: | 73 public: |
74 NaClDomHandler(); | 74 NaClDomHandler(); |
75 virtual ~NaClDomHandler(); | 75 virtual ~NaClDomHandler(); |
76 | 76 |
77 // WebUIMessageHandler implementation. | 77 // WebUIMessageHandler implementation. |
78 virtual void RegisterMessages() OVERRIDE; | 78 virtual void RegisterMessages() override; |
79 | 79 |
80 private: | 80 private: |
81 // Callback for the "requestNaClInfo" message. | 81 // Callback for the "requestNaClInfo" message. |
82 void HandleRequestNaClInfo(const base::ListValue* args); | 82 void HandleRequestNaClInfo(const base::ListValue* args); |
83 | 83 |
84 // Callback for the NaCl plugin information. | 84 // Callback for the NaCl plugin information. |
85 void OnGotPlugins(const std::vector<content::WebPluginInfo>& plugins); | 85 void OnGotPlugins(const std::vector<content::WebPluginInfo>& plugins); |
86 | 86 |
87 // A helper callback that receives the result of checking if PNaCl path | 87 // A helper callback that receives the result of checking if PNaCl path |
88 // exists and checking the PNaCl |version|. |is_valid| is true if the PNaCl | 88 // exists and checking the PNaCl |version|. |is_valid| is true if the PNaCl |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 | 382 |
383 NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 383 NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
384 content::RecordAction(UserMetricsAction("ViewAboutNaCl")); | 384 content::RecordAction(UserMetricsAction("ViewAboutNaCl")); |
385 | 385 |
386 web_ui->AddMessageHandler(new NaClDomHandler()); | 386 web_ui->AddMessageHandler(new NaClDomHandler()); |
387 | 387 |
388 // Set up the about:nacl source. | 388 // Set up the about:nacl source. |
389 Profile* profile = Profile::FromWebUI(web_ui); | 389 Profile* profile = Profile::FromWebUI(web_ui); |
390 content::WebUIDataSource::Add(profile, CreateNaClUIHTMLSource()); | 390 content::WebUIDataSource::Add(profile, CreateNaClUIHTMLSource()); |
391 } | 391 } |
OLD | NEW |