Commit d568e2f3 authored by Jimmy Gong's avatar Jimmy Gong Committed by Commit Bot

Add PrintingManager mojom js bindings to UI

- Hooks up the Mojo handler interface to the Print Management app.
- Generates js-lite bindings from printing_manager.mojom.

Bug: 1053704
Change-Id: If5df4fe8313e510de0548a72b50277bda585535a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2117163Reviewed-by: default avatarcalamity <calamity@chromium.org>
Reviewed-by: default avatarZentaro Kavanagh <zentaro@chromium.org>
Reviewed-by: default avatarSamuel Huang <huangs@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarTom Sepez <tsepez@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarBailey Berro <baileyberro@chromium.org>
Commit-Queue: jimmy gong <jimmyxgong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756077}
parent 21d3d145
...@@ -140,6 +140,8 @@ ...@@ -140,6 +140,8 @@
#include "chromeos/components/media_app_ui/media_app_ui.h" #include "chromeos/components/media_app_ui/media_app_ui.h"
#include "chromeos/components/media_app_ui/media_app_ui.mojom.h" #include "chromeos/components/media_app_ui/media_app_ui.mojom.h"
#include "chromeos/components/multidevice/debug_webui/proximity_auth_ui.h" #include "chromeos/components/multidevice/debug_webui/proximity_auth_ui.h"
#include "chromeos/components/print_management/mojom/printing_manager.mojom.h"
#include "chromeos/components/print_management/print_management_ui.h"
#include "chromeos/services/cellular_setup/public/mojom/cellular_setup.mojom.h" #include "chromeos/services/cellular_setup/public/mojom/cellular_setup.mojom.h"
#include "chromeos/services/multidevice_setup/multidevice_setup_service.h" #include "chromeos/services/multidevice_setup/multidevice_setup_service.h"
#include "chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom.h" #include "chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom.h"
...@@ -525,6 +527,10 @@ void PopulateChromeWebUIFrameBinders( ...@@ -525,6 +527,10 @@ void PopulateChromeWebUIFrameBinders(
chromeos::NetworkUI, chromeos::OobeUI, chromeos::settings::OSSettingsUI>( chromeos::NetworkUI, chromeos::OobeUI, chromeos::settings::OSSettingsUI>(
map); map);
RegisterWebUIControllerInterfaceBinder<
chromeos::printing::printing_manager::mojom::PrintingMetadataProvider,
chromeos::printing::printing_manager::PrintManagementUI>(map);
RegisterWebUIControllerInterfaceBinder<help_app_ui::mojom::PageHandlerFactory, RegisterWebUIControllerInterfaceBinder<help_app_ui::mojom::PageHandlerFactory,
chromeos::HelpAppUI>(map); chromeos::HelpAppUI>(map);
......
...@@ -2154,6 +2154,8 @@ source_set("chromeos") { ...@@ -2154,6 +2154,8 @@ source_set("chromeos") {
"printing/print_management/print_job_info_mojom_conversions.h", "printing/print_management/print_job_info_mojom_conversions.h",
"printing/print_management/printing_manager.cc", "printing/print_management/printing_manager.cc",
"printing/print_management/printing_manager.h", "printing/print_management/printing_manager.h",
"printing/print_management/printing_manager_factory.cc",
"printing/print_management/printing_manager_factory.h",
"printing/print_server.cc", "printing/print_server.cc",
"printing/print_server.h", "printing/print_server.h",
"printing/print_servers_provider.cc", "printing/print_servers_provider.cc",
......
...@@ -49,6 +49,10 @@ void PrintingManager::BindInterface( ...@@ -49,6 +49,10 @@ void PrintingManager::BindInterface(
receiver_.Bind(std::move(pending_receiver)); receiver_.Bind(std::move(pending_receiver));
} }
void PrintingManager::Shutdown() {
receiver_.reset();
}
} // namespace print_management } // namespace print_management
} // namespace printing } // namespace printing
} // namespace chromeos } // namespace chromeos
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "chrome/browser/chromeos/printing/history/print_job_info.pb.h" #include "chrome/browser/chromeos/printing/history/print_job_info.pb.h"
#include "chromeos/components/print_management/mojom/printing_manager.mojom.h" #include "chromeos/components/print_management/mojom/printing_manager.mojom.h"
#include "components/keyed_service/core/keyed_service.h"
#include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/receiver.h"
...@@ -17,7 +18,8 @@ namespace printing { ...@@ -17,7 +18,8 @@ namespace printing {
namespace mojom = printing_manager::mojom; namespace mojom = printing_manager::mojom;
namespace print_management { namespace print_management {
class PrintingManager : public mojom::PrintingMetadataProvider { class PrintingManager : public mojom::PrintingMetadataProvider,
public KeyedService {
public: public:
explicit PrintingManager(Profile* profile); explicit PrintingManager(Profile* profile);
~PrintingManager() override; ~PrintingManager() override;
...@@ -25,13 +27,16 @@ class PrintingManager : public mojom::PrintingMetadataProvider { ...@@ -25,13 +27,16 @@ class PrintingManager : public mojom::PrintingMetadataProvider {
PrintingManager(const PrintingManager&) = delete; PrintingManager(const PrintingManager&) = delete;
PrintingManager& operator=(const PrintingManager&) = delete; PrintingManager& operator=(const PrintingManager&) = delete;
// mojom::PrintingMetadataProvider implementation // mojom::PrintingMetadataProvider:
void GetPrintJobs(GetPrintJobsCallback callback) override; void GetPrintJobs(GetPrintJobsCallback callback) override;
void BindInterface( void BindInterface(
mojo::PendingReceiver<mojom::PrintingMetadataProvider> pending_receiver); mojo::PendingReceiver<mojom::PrintingMetadataProvider> pending_receiver);
private: private:
// KeyedService:
void Shutdown() override;
void OnPrintJobsRetrieved( void OnPrintJobsRetrieved(
GetPrintJobsCallback callback, GetPrintJobsCallback callback,
bool success, bool success,
...@@ -39,6 +44,7 @@ class PrintingManager : public mojom::PrintingMetadataProvider { ...@@ -39,6 +44,7 @@ class PrintingManager : public mojom::PrintingMetadataProvider {
print_job_info_protos); print_job_info_protos);
mojo::Receiver<mojom::PrintingMetadataProvider> receiver_{this}; mojo::Receiver<mojom::PrintingMetadataProvider> receiver_{this};
Profile* profile_; // Not Owned. Profile* profile_; // Not Owned.
}; };
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/printing/print_management/printing_manager_factory.h"
#include "chrome/browser/chromeos/printing/history/print_job_history_service_factory.h"
#include "chrome/browser/chromeos/printing/print_management/printing_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
namespace chromeos {
namespace printing {
namespace print_management {
// static
PrintingManager* PrintingManagerFactory::GetForProfile(Profile* profile) {
return static_cast<PrintingManager*>(
PrintingManagerFactory::GetInstance()->GetServiceForBrowserContext(
profile, /*create=*/true));
}
// static
PrintingManagerFactory* PrintingManagerFactory::GetInstance() {
return base::Singleton<PrintingManagerFactory>::get();
}
PrintingManagerFactory::PrintingManagerFactory()
: BrowserContextKeyedServiceFactory(
"PrintingManager",
BrowserContextDependencyManager::GetInstance()) {
DependsOn(PrintJobHistoryServiceFactory::GetInstance());
}
PrintingManagerFactory::~PrintingManagerFactory() = default;
KeyedService* PrintingManagerFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
return new PrintingManager(Profile::FromBrowserContext(context));
}
} // namespace print_management
} // namespace printing
} // namespace chromeos
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_PRINTING_PRINT_MANAGEMENT_PRINTING_MANAGER_FACTORY_H_
#define CHROME_BROWSER_CHROMEOS_PRINTING_PRINT_MANAGEMENT_PRINTING_MANAGER_FACTORY_H_
#include "base/memory/singleton.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
class Profile;
namespace chromeos {
namespace printing {
namespace print_management {
class PrintingManager;
// Factory for PrintingManager.
class PrintingManagerFactory : public BrowserContextKeyedServiceFactory {
public:
static PrintingManager* GetForProfile(Profile* profile);
static PrintingManagerFactory* GetInstance();
private:
friend struct base::DefaultSingletonTraits<PrintingManagerFactory>;
PrintingManagerFactory();
~PrintingManagerFactory() override;
PrintingManagerFactory(const PrintingManagerFactory&) = delete;
PrintingManagerFactory& operator=(const PrintingManagerFactory&) = delete;
// BrowserContextKeyedServiceFactory:
KeyedService* BuildServiceInstanceFor(
content::BrowserContext* context) const override;
};
} // namespace print_management
} // namespace printing
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_PRINTING_PRINT_MANAGEMENT_PRINTING_MANAGER_FACTORY_H_
...@@ -160,6 +160,8 @@ ...@@ -160,6 +160,8 @@
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service.h" #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service.h"
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_factory.h" #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_factory.h"
#include "chrome/browser/chromeos/multidevice_setup/multidevice_setup_service_factory.h" #include "chrome/browser/chromeos/multidevice_setup/multidevice_setup_service_factory.h"
#include "chrome/browser/chromeos/printing/print_management/printing_manager.h"
#include "chrome/browser/chromeos/printing/print_management/printing_manager_factory.h"
#include "chrome/browser/chromeos/secure_channel/secure_channel_client_provider.h" #include "chrome/browser/chromeos/secure_channel/secure_channel_client_provider.h"
#include "chrome/browser/chromeos/web_applications/chrome_help_app_ui_delegate.h" #include "chrome/browser/chromeos/web_applications/chrome_help_app_ui_delegate.h"
#include "chrome/browser/chromeos/web_applications/chrome_media_app_ui_delegate.h" #include "chrome/browser/chromeos/web_applications/chrome_media_app_ui_delegate.h"
...@@ -318,6 +320,28 @@ WebUIController* NewWebUI<chromeos::MediaAppUI>(WebUI* web_ui, ...@@ -318,6 +320,28 @@ WebUIController* NewWebUI<chromeos::MediaAppUI>(WebUI* web_ui,
return new chromeos::MediaAppUI(web_ui, std::move(delegate)); return new chromeos::MediaAppUI(web_ui, std::move(delegate));
} }
void BindPrintManagement(
Profile* profile,
mojo::PendingReceiver<
chromeos::printing::printing_manager::mojom::PrintingMetadataProvider>
receiver) {
chromeos::printing::print_management::PrintingManager* handler =
chromeos::printing::print_management::PrintingManagerFactory::
GetForProfile(profile);
if (handler)
handler->BindInterface(std::move(receiver));
}
template <>
WebUIController*
NewWebUI<chromeos::printing::printing_manager::PrintManagementUI>(
WebUI* web_ui,
const GURL& url) {
return new chromeos::printing::printing_manager::PrintManagementUI(
web_ui,
base::BindRepeating(&BindPrintManagement, Profile::FromWebUI(web_ui)));
}
void BindMultiDeviceSetup( void BindMultiDeviceSetup(
Profile* profile, Profile* profile,
mojo::PendingReceiver<chromeos::multidevice_setup::mojom::MultiDeviceSetup> mojo::PendingReceiver<chromeos::multidevice_setup::mojom::MultiDeviceSetup>
...@@ -587,7 +611,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, ...@@ -587,7 +611,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
if (base::FeatureList::IsEnabled( if (base::FeatureList::IsEnabled(
chromeos::features::kPrintJobManagementApp) && chromeos::features::kPrintJobManagementApp) &&
url.host_piece() == chromeos::kChromeUIPrintManagementHost) url.host_piece() == chromeos::kChromeUIPrintManagementHost)
return &NewWebUI<chromeos::PrintManagementUI>; return &NewWebUI<chromeos::printing::printing_manager::PrintManagementUI>;
if (base::FeatureList::IsEnabled(chromeos::features::kScanningUI) && if (base::FeatureList::IsEnabled(chromeos::features::kScanningUI) &&
url.host_piece() == chromeos::kChromeUIScanningHost) { url.host_piece() == chromeos::kChromeUIScanningHost) {
return &NewWebUI<chromeos::ScanningUI>; return &NewWebUI<chromeos::ScanningUI>;
......
...@@ -15,6 +15,7 @@ static_library("print_management") { ...@@ -15,6 +15,7 @@ static_library("print_management") {
] ]
deps = [ deps = [
"//chromeos/components/print_management/mojom",
"//chromeos/constants", "//chromeos/constants",
"//chromeos/resources:print_management_resources", "//chromeos/resources:print_management_resources",
"//content/public/browser", "//content/public/browser",
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "chromeos/components/print_management/print_management_ui.h" #include "chromeos/components/print_management/print_management_ui.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "chromeos/components/print_management/mojom/printing_manager.mojom.h"
#include "chromeos/components/print_management/url_constants.h" #include "chromeos/components/print_management/url_constants.h"
#include "chromeos/grit/chromeos_print_management_resources.h" #include "chromeos/grit/chromeos_print_management_resources.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
...@@ -13,9 +14,14 @@ ...@@ -13,9 +14,14 @@
#include "ui/resources/grit/webui_resources.h" #include "ui/resources/grit/webui_resources.h"
namespace chromeos { namespace chromeos {
namespace printing {
PrintManagementUI::PrintManagementUI(content::WebUI* web_ui) namespace printing_manager {
: ui::MojoWebUIController(web_ui) {
PrintManagementUI::PrintManagementUI(
content::WebUI* web_ui,
BindPrintingMetadataProviderCallback callback)
: ui::MojoWebUIController(web_ui),
bind_pending_receiver_callback_(std::move(callback)) {
auto html_source = base::WrapUnique( auto html_source = base::WrapUnique(
content::WebUIDataSource::Create(kChromeUIPrintManagementHost)); content::WebUIDataSource::Create(kChromeUIPrintManagementHost));
html_source->OverrideContentSecurityPolicyScriptSrc( html_source->OverrideContentSecurityPolicyScriptSrc(
...@@ -24,10 +30,14 @@ PrintManagementUI::PrintManagementUI(content::WebUI* web_ui) ...@@ -24,10 +30,14 @@ PrintManagementUI::PrintManagementUI(content::WebUI* web_ui)
html_source->AddResourcePath("print_management.js", IDR_PRINT_MANAGEMENT_JS); html_source->AddResourcePath("print_management.js", IDR_PRINT_MANAGEMENT_JS);
html_source->AddResourcePath("test_loader.js", IDR_WEBUI_JS_TEST_LOADER); html_source->AddResourcePath("test_loader.js", IDR_WEBUI_JS_TEST_LOADER);
html_source->AddResourcePath("test_loader.html", IDR_WEBUI_HTML_TEST_LOADER); html_source->AddResourcePath("test_loader.html", IDR_WEBUI_HTML_TEST_LOADER);
html_source->SetDefaultResource(IDR_PRINT_MANAGEMENT_INDEX_HTML); html_source->AddResourcePath("printing_manager.mojom-lite.js",
IDR_PRINTING_MANAGER_MOJO_LITE_JS);
html_source->AddResourcePath("mojo_interface_provider.js",
IDR_PRINT_MANAGEMENT_MOJO_INTERFACE_PROVIDER_JS);
html_source->AddResourcePath("pwa.html", IDR_PRINT_MANAGEMENT_PWA_HTML); html_source->AddResourcePath("pwa.html", IDR_PRINT_MANAGEMENT_PWA_HTML);
html_source->AddResourcePath("manifest.json", IDR_PRINT_MANAGEMENT_MANIFEST); html_source->AddResourcePath("manifest.json", IDR_PRINT_MANAGEMENT_MANIFEST);
html_source->AddResourcePath("app_icon_192.png", IDR_PRINT_MANAGEMENT_ICON); html_source->AddResourcePath("app_icon_192.png", IDR_PRINT_MANAGEMENT_ICON);
html_source->SetDefaultResource(IDR_PRINT_MANAGEMENT_INDEX_HTML);
content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(),
html_source.release()); html_source.release());
...@@ -35,4 +45,13 @@ PrintManagementUI::PrintManagementUI(content::WebUI* web_ui) ...@@ -35,4 +45,13 @@ PrintManagementUI::PrintManagementUI(content::WebUI* web_ui)
PrintManagementUI::~PrintManagementUI() = default; PrintManagementUI::~PrintManagementUI() = default;
void PrintManagementUI::BindInterface(
mojo::PendingReceiver<mojom::PrintingMetadataProvider> receiver) {
bind_pending_receiver_callback_.Run(std::move(receiver));
}
WEB_UI_CONTROLLER_TYPE_IMPL(PrintManagementUI)
} // namespace printing_manager
} // namespace printing
} // namespace chromeos } // namespace chromeos
...@@ -2,23 +2,45 @@ ...@@ -2,23 +2,45 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chromeos/components/print_management/mojom/printing_manager.mojom-forward.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "ui/webui/mojo_web_ui_controller.h" #include "ui/webui/mojo_web_ui_controller.h"
#ifndef CHROMEOS_COMPONENTS_PRINT_MANAGEMENT_PRINT_MANAGEMENT_UI_H_ #ifndef CHROMEOS_COMPONENTS_PRINT_MANAGEMENT_PRINT_MANAGEMENT_UI_H_
#define CHROMEOS_COMPONENTS_PRINT_MANAGEMENT_PRINT_MANAGEMENT_UI_H_ #define CHROMEOS_COMPONENTS_PRINT_MANAGEMENT_PRINT_MANAGEMENT_UI_H_
namespace chromeos { namespace chromeos {
namespace printing {
namespace printing_manager {
// The WebUI for chrome://print-management/. // The WebUI for chrome://print-management/.
class PrintManagementUI : public ui::MojoWebUIController { class PrintManagementUI : public ui::MojoWebUIController {
public: public:
explicit PrintManagementUI(content::WebUI* web_ui); using BindPrintingMetadataProviderCallback = base::RepeatingCallback<void(
mojo::PendingReceiver<mojom::PrintingMetadataProvider>)>;
// |callback_| should bind the pending receiver to an implementation of
// mojom::PrintingMetadataProvider.
PrintManagementUI(content::WebUI* web_ui,
BindPrintingMetadataProviderCallback callback_);
~PrintManagementUI() override; ~PrintManagementUI() override;
PrintManagementUI(const PrintManagementUI&) = delete; PrintManagementUI(const PrintManagementUI&) = delete;
PrintManagementUI& operator=(const PrintManagementUI&) = delete; PrintManagementUI& operator=(const PrintManagementUI&) = delete;
// Instantiates implementor of the mojom::PrintingManager mojo interface by
// passing the pending receiver that will be internally bound.
void BindInterface(
mojo::PendingReceiver<mojom::PrintingMetadataProvider> receiver);
private:
const BindPrintingMetadataProviderCallback bind_pending_receiver_callback_;
WEB_UI_CONTROLLER_TYPE_DECL();
}; };
} // namespace printing_manager
} // namespace printing
} // namespace chromeos } // namespace chromeos
#endif // CHROMEOS_COMPONENTS_PRINT_MANAGEMENT_PRINT_MANAGEMENT_UI_H_ #endif // CHROMEOS_COMPONENTS_PRINT_MANAGEMENT_PRINT_MANAGEMENT_UI_H_
...@@ -9,15 +9,26 @@ import("//tools/polymer/polymer.gni") ...@@ -9,15 +9,26 @@ import("//tools/polymer/polymer.gni")
js_type_check("closure_compile_module") { js_type_check("closure_compile_module") {
is_polymer3 = true is_polymer3 = true
deps = [ ":print_management" ] deps = [
":mojo_interface_provider",
":print_management",
]
} }
js_library("print_management") { js_library("print_management") {
deps = [ deps = [
":mojo_interface_provider",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
] ]
} }
js_library("mojo_interface_provider") {
deps = [
"//chromeos/components/print_management/mojom:mojom_js_library_for_compile",
"//ui/webui/resources/js:cr.m",
]
}
polymer_modulizer("print_management") { polymer_modulizer("print_management") {
js_file = "print_management.js" js_file = "print_management.js"
html_file = "print_management.html" html_file = "print_management.html"
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js';
import 'chrome://resources/mojo/mojo/public/mojom/base/big_buffer.mojom-lite.js';
import 'chrome://resources/mojo/mojo/public/mojom/base/string16.mojom-lite.js';
import 'chrome://resources/mojo/mojo/public/mojom/base/time.mojom-lite.js';
import 'chrome://resources/mojo/url/mojom/url.mojom-lite.js';
import './printing_manager.mojom-lite.js';
/**
* @type {
* ?chromeos.printing.printingManager.mojom.PrintingMetadataProviderInterface
* }
*/
let metadataProvider = null;
/**
* @param {
* !chromeos.printing.printingManager.mojom.PrintingMetadataProviderInterface
* } testProvider
*/
export function setMetadataProviderForTesting(testProvider) {
metadataProvider = testProvider;
}
/**
* @return {
* !chromeos.printing.printingManager.mojom.PrintingMetadataProviderInterface
* }
*/
export function getMetadataProvider() {
if (metadataProvider) {
return metadataProvider;
}
metadataProvider = chromeos.printing.printingManager.mojom
.PrintingMetadataProvider.getRemote();
return metadataProvider;
}
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
import {getMetadataProvider} from './mojo_interface_provider.js';
/** /**
* @fileoverview * @fileoverview
...@@ -13,10 +14,21 @@ Polymer({ ...@@ -13,10 +14,21 @@ Polymer({
_template: html`{__html_template__}`, _template: html`{__html_template__}`,
/**
* @private {
* ?chromeos.printing.printingManager.mojom.PrintingMetadataProviderInterface
* }
*/
mojoInterfaceProvider_: null,
/** @override */
created() {
this.mojoInterfaceProvider_ = getMetadataProvider();
},
/** @override */ /** @override */
ready() { ready() {
// TODO(jimmyxgong): Remove this once the app has more capabilities. // TODO(jimmyxgong): Remove this once the app has more capabilities.
this.$$('#header').textContent = 'Print Management'; this.$$('#header').textContent = 'Print Management';
}, },
}); });
...@@ -17,9 +17,15 @@ ...@@ -17,9 +17,15 @@
<include name="IDR_PRINT_MANAGEMENT_JS" file="${root_gen_dir}/chromeos/components/print_management/resources/print_management.js" use_base_dir="false" compress="gzip" type="BINDATA"/> <include name="IDR_PRINT_MANAGEMENT_JS" file="${root_gen_dir}/chromeos/components/print_management/resources/print_management.js" use_base_dir="false" compress="gzip" type="BINDATA"/>
<include name="IDR_PRINT_MANAGEMENT_MANIFEST" file="manifest.json" type="BINDATA" compress="gzip" /> <include name="IDR_PRINT_MANAGEMENT_MANIFEST" file="manifest.json" type="BINDATA" compress="gzip" />
<include name="IDR_PRINT_MANAGEMENT_ICON" file="app_icon_192.png" type="BINDATA" compress="gzip" /> <include name="IDR_PRINT_MANAGEMENT_ICON" file="app_icon_192.png" type="BINDATA" compress="gzip" />
<include name="IDR_PRINT_MANAGEMENT_PWA_HTML" file="pwa.html" type="BINDATA" compress="gzip" /> <include name="IDR_PRINTING_MANAGER_MOJO_LITE_JS" file="${root_gen_dir}/chromeos/components/print_management/mojom/printing_manager.mojom-lite.js" compress="gzip" use_base_dir="false" type="BINDATA" />
<include name="IDR_PRINT_MANAGEMENT_PWA_HTML" file="pwa.html" type="BINDATA" compress="gzip" />
<include name="IDR_SCANNING_UI_INDEX_HTML" file="scanning_ui_index.html" type="BINDATA" compress="gzip" /> <include name="IDR_SCANNING_UI_INDEX_HTML" file="scanning_ui_index.html" type="BINDATA" compress="gzip" />
<include name="IDR_SCANNING_UI_JS" file="${root_gen_dir}/chromeos/components/print_management/resources/scanning_ui.js" use_base_dir="false" compress="gzip" type="BINDATA"/> <include name="IDR_SCANNING_UI_JS" file="${root_gen_dir}/chromeos/components/print_management/resources/scanning_ui.js" use_base_dir="false" compress="gzip" type="BINDATA"/>
</includes> </includes>
<structures>
<structure name="IDR_PRINT_MANAGEMENT_MOJO_INTERFACE_PROVIDER_JS"
file="mojo_interface_provider.js" type="chrome_html"/>
</structures>
</release> </release>
</grit> </grit>
\ No newline at end of file
...@@ -140,7 +140,10 @@ grit("print_management_resources") { ...@@ -140,7 +140,10 @@ grit("print_management_resources") {
source = source =
"../components/print_management/resources/print_management_resources.grd" "../components/print_management/resources/print_management_resources.grd"
deps = [ "../components/print_management/resources:polymer3_elements" ] deps = [
"../components/print_management/mojom:mojom_js",
"../components/print_management/resources:polymer3_elements",
]
outputs = [ outputs = [
"grit/chromeos_print_management_resources.h", "grit/chromeos_print_management_resources.h",
......
...@@ -308,12 +308,13 @@ ...@@ -308,12 +308,13 @@
"chromeos/components/print_management/resources/print_management_resources.grd": { "chromeos/components/print_management/resources/print_management_resources.grd": {
"META": {"join": 2}, "META": {"join": 2},
"includes": [2600], "includes": [2600],
"structures": [2620],
}, },
"chromeos/components/sample_system_web_app_ui/resources/sample_system_web_app_resources.grd": { "chromeos/components/sample_system_web_app_ui/resources/sample_system_web_app_resources.grd": {
"includes": [2620], "includes": [2640],
}, },
"chromeos/resources/chromeos_resources.grd": { "chromeos/resources/chromeos_resources.grd": {
"includes": [2640], "includes": [2660],
}, },
# END chromeos/ section. # END chromeos/ section.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment