Move notification-related code into a new NotificationPresenter class
This commit is contained in:
parent
1328c85eef
commit
3c41af84a1
6 changed files with 58 additions and 5 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include "browser_context.h"
|
||||
#include "browser_main_parts.h"
|
||||
#include "notification_presenter.h"
|
||||
|
||||
namespace brightray {
|
||||
|
||||
|
@ -19,6 +20,12 @@ BrowserContext* BrowserClient::browser_context() {
|
|||
return browser_main_parts_->browser_context();
|
||||
}
|
||||
|
||||
NotificationPresenter* BrowserClient::notification_presenter() {
|
||||
if (!notification_presenter_)
|
||||
notification_presenter_.reset(new NotificationPresenter);
|
||||
return notification_presenter_.get();
|
||||
}
|
||||
|
||||
BrowserMainParts* BrowserClient::OverrideCreateBrowserMainParts(const content::MainFunctionParams&) {
|
||||
return new BrowserMainParts;
|
||||
}
|
||||
|
@ -33,4 +40,12 @@ net::URLRequestContextGetter* BrowserClient::CreateRequestContext(content::Brows
|
|||
return static_cast<BrowserContext*>(browser_context)->CreateRequestContext(protocol_handlers);
|
||||
}
|
||||
|
||||
void BrowserClient::ShowDesktopNotification(
|
||||
const content::ShowDesktopNotificationHostMsgParams& params,
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
bool worker) {
|
||||
notification_presenter()->ShowNotification(params, render_process_id, render_view_id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue