Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(535)

Side by Side Diff: athena/extensions/extensions_delegate.cc

Issue 692563002: JS dialogs for athena (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix deps Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « athena/extensions/athena_javascript_native_dialog_factory.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "athena/extensions/public/extensions_delegate.h" 5 #include "athena/extensions/public/extensions_delegate.h"
6 6
7 #include "athena/extensions/athena_constrained_window_views_client.h"
8 #include "athena/extensions/athena_javascript_native_dialog_factory.h"
7 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "extensions/components/javascript_dialog_extensions_client/javascript_d ialog_extension_client_impl.h"
8 11
9 namespace athena { 12 namespace athena {
10 namespace { 13 namespace {
11 14
12 ExtensionsDelegate* instance = nullptr; 15 ExtensionsDelegate* instance = nullptr;
13 16
14 } // namespace 17 } // namespace
15 18
16 ExtensionsDelegate::ExtensionsDelegate() { 19 ExtensionsDelegate::ExtensionsDelegate() {
20 InstallConstrainedWindowViewsClient();
21 InstallJavaScriptDialogExtensionsClient();
22 InstallJavaScriptNativeDialogFactory();
17 DCHECK(!instance); 23 DCHECK(!instance);
18 instance = this; 24 instance = this;
19 } 25 }
20 26
21 ExtensionsDelegate::~ExtensionsDelegate() { 27 ExtensionsDelegate::~ExtensionsDelegate() {
28 UninstallConstrainedWindowViewsClient();
22 DCHECK(instance); 29 DCHECK(instance);
23 instance = nullptr; 30 instance = nullptr;
24 } 31 }
25 32
26 // static 33 // static
27 ExtensionsDelegate* ExtensionsDelegate::Get(content::BrowserContext* context) { 34 ExtensionsDelegate* ExtensionsDelegate::Get(content::BrowserContext* context) {
28 DCHECK(instance); 35 DCHECK(instance);
29 DCHECK_EQ(context, instance->GetBrowserContext()); 36 DCHECK_EQ(context, instance->GetBrowserContext());
30 return instance; 37 return instance;
31 } 38 }
32 39
33 // static 40 // static
34 void ExtensionsDelegate::Shutdown() { 41 void ExtensionsDelegate::Shutdown() {
35 DCHECK(instance); 42 DCHECK(instance);
36 delete instance; 43 delete instance;
37 } 44 }
38 45
39 } // namespace athena 46 } // namespace athena
OLDNEW
« no previous file with comments | « athena/extensions/athena_javascript_native_dialog_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698