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

Side by Side Diff: chrome/browser/chrome_browser_main_android.cc

Issue 666533007: Move JavaScriptDialogManager, JavascriptAppModalDialogViews to components/app_modal_dialogs (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: 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
OLDNEW
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/chrome_browser_main_android.h" 5 #include "chrome/browser/chrome_browser_main_android.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" 10 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h"
11 #include "chrome/browser/google/google_search_counter_android.h" 11 #include "chrome/browser/google/google_search_counter_android.h"
12 #include "chrome/browser/signin/signin_manager_factory.h" 12 #include "chrome/browser/signin/signin_manager_factory.h"
13 #include "chrome/browser/ui/app_modal_dialogs/chrome_javascript_dialog_manager_c lient.h"
13 #include "chrome/common/chrome_paths.h" 14 #include "chrome/common/chrome_paths.h"
14 #include "chrome/common/chrome_switches.h" 15 #include "chrome/common/chrome_switches.h"
15 #include "components/crash/app/breakpad_linux.h" 16 #include "components/crash/app/breakpad_linux.h"
16 #include "components/crash/browser/crash_dump_manager_android.h" 17 #include "components/crash/browser/crash_dump_manager_android.h"
17 #include "components/signin/core/browser/signin_manager.h" 18 #include "components/signin/core/browser/signin_manager.h"
18 #include "content/public/browser/android/compositor.h" 19 #include "content/public/browser/android/compositor.h"
19 #include "content/public/common/main_function_params.h" 20 #include "content/public/common/main_function_params.h"
20 #include "net/android/network_change_notifier_factory_android.h" 21 #include "net/android/network_change_notifier_factory_android.h"
21 #include "net/base/network_change_notifier.h" 22 #include "net/base/network_change_notifier.h"
22 #include "ui/base/ui_base_paths.h" 23 #include "ui/base/ui_base_paths.h"
23 24
24 ChromeBrowserMainPartsAndroid::ChromeBrowserMainPartsAndroid( 25 ChromeBrowserMainPartsAndroid::ChromeBrowserMainPartsAndroid(
25 const content::MainFunctionParams& parameters) 26 const content::MainFunctionParams& parameters)
26 : ChromeBrowserMainParts(parameters) { 27 : ChromeBrowserMainParts(parameters) {
27 } 28 }
28 29
29 ChromeBrowserMainPartsAndroid::~ChromeBrowserMainPartsAndroid() { 30 ChromeBrowserMainPartsAndroid::~ChromeBrowserMainPartsAndroid() {
31 SetJavaScriptDialogManagerClient(nullptr);
30 } 32 }
31 33
32 void ChromeBrowserMainPartsAndroid::PreProfileInit() { 34 void ChromeBrowserMainPartsAndroid::PreProfileInit() {
33 TRACE_EVENT0("startup", "ChromeBrowserMainPartsAndroid::PreProfileInit") 35 TRACE_EVENT0("startup", "ChromeBrowserMainPartsAndroid::PreProfileInit")
34 #if defined(GOOGLE_CHROME_BUILD) 36 #if defined(GOOGLE_CHROME_BUILD)
35 // TODO(jcivelli): we should not initialize the crash-reporter when it was not 37 // TODO(jcivelli): we should not initialize the crash-reporter when it was not
36 // enabled. Right now if it is disabled we still generate the minidumps but we 38 // enabled. Right now if it is disabled we still generate the minidumps but we
37 // do not upload them. 39 // do not upload them.
38 bool breakpad_enabled = true; 40 bool breakpad_enabled = true;
39 #else 41 #else
40 bool breakpad_enabled = false; 42 bool breakpad_enabled = false;
41 #endif 43 #endif
44 SetJavaScriptDialogManagerClient(
msw 2014/10/30 00:20:31 Does this need to happen so early? Can someone mor
45 make_scoped_ptr(new ChromeJavaScriptDialogManagerClient));
msw 2014/10/30 00:20:31 Why do android, mac, and views all do this separat
oshima 2014/10/31 15:54:45 Moved to chrome_browser_main.cc. Let me know if yo
42 46
43 // Allow Breakpad to be enabled in Chromium builds for testing purposes. 47 // Allow Breakpad to be enabled in Chromium builds for testing purposes.
44 if (!breakpad_enabled) 48 if (!breakpad_enabled)
45 breakpad_enabled = CommandLine::ForCurrentProcess()->HasSwitch( 49 breakpad_enabled = CommandLine::ForCurrentProcess()->HasSwitch(
46 switches::kEnableCrashReporterForTesting); 50 switches::kEnableCrashReporterForTesting);
47 51
48 if (breakpad_enabled) { 52 if (breakpad_enabled) {
49 base::FilePath crash_dump_dir; 53 base::FilePath crash_dump_dir;
50 PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_dir); 54 PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_dir);
51 crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dump_dir)); 55 crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dump_dir));
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 "ChromeBrowserMainPartsAndroid::PreEarlyInitialization:StartUiMsgLoop"); 91 "ChromeBrowserMainPartsAndroid::PreEarlyInitialization:StartUiMsgLoop");
88 base::MessageLoopForUI::current()->Start(); 92 base::MessageLoopForUI::current()->Start();
89 } 93 }
90 94
91 ChromeBrowserMainParts::PreEarlyInitialization(); 95 ChromeBrowserMainParts::PreEarlyInitialization();
92 } 96 }
93 97
94 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() { 98 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() {
95 NOTREACHED(); 99 NOTREACHED();
96 } 100 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698