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

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

Issue 497563002: [Android] Use correct enhanced bookmarks enabling logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: call UpdateBookmarksExperimentState on startup, JNI binding, etc.. Created 6 years, 3 months 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/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"
11 #include "chrome/common/chrome_paths.h" 13 #include "chrome/common/chrome_paths.h"
12 #include "chrome/common/chrome_switches.h" 14 #include "chrome/common/chrome_switches.h"
13 #include "components/breakpad/app/breakpad_linux.h" 15 #include "components/breakpad/app/breakpad_linux.h"
14 #include "components/breakpad/browser/crash_dump_manager_android.h" 16 #include "components/breakpad/browser/crash_dump_manager_android.h"
17 #include "components/signin/core/browser/signin_manager.h"
15 #include "content/public/browser/android/compositor.h" 18 #include "content/public/browser/android/compositor.h"
16 #include "content/public/common/main_function_params.h" 19 #include "content/public/common/main_function_params.h"
17 #include "net/android/network_change_notifier_factory_android.h" 20 #include "net/android/network_change_notifier_factory_android.h"
18 #include "net/base/network_change_notifier.h" 21 #include "net/base/network_change_notifier.h"
19 #include "ui/base/ui_base_paths.h" 22 #include "ui/base/ui_base_paths.h"
20 23
21 ChromeBrowserMainPartsAndroid::ChromeBrowserMainPartsAndroid( 24 ChromeBrowserMainPartsAndroid::ChromeBrowserMainPartsAndroid(
22 const content::MainFunctionParams& parameters) 25 const content::MainFunctionParams& parameters)
23 : ChromeBrowserMainParts(parameters) { 26 : ChromeBrowserMainParts(parameters) {
24 } 27 }
(...skipping 20 matching lines...) Expand all
45 if (breakpad_enabled) { 48 if (breakpad_enabled) {
46 base::FilePath crash_dump_dir; 49 base::FilePath crash_dump_dir;
47 PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_dir); 50 PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_dir);
48 crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dump_dir)); 51 crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dump_dir));
49 } 52 }
50 53
51 ChromeBrowserMainParts::PreProfileInit(); 54 ChromeBrowserMainParts::PreProfileInit();
52 } 55 }
53 56
54 void ChromeBrowserMainPartsAndroid::PostProfileInit() { 57 void ChromeBrowserMainPartsAndroid::PostProfileInit() {
55 search_counter_.reset(new GoogleSearchCounterAndroid(profile())); 58 Profile* profilez = profile();
59
60 search_counter_.reset(new GoogleSearchCounterAndroid(profilez));
61
62 SigninManagerBase* signin = SigninManagerFactory::GetForProfile(profilez);
63 bool is_signed_in = signin && !signin->GetAuthenticatedUsername().empty();
64 UpdateBookmarksExperimentState(
65 profilez->GetPrefs(),
66 local_state(),
67 is_signed_in,
68 BOOKMARKS_EXPERIMENT_ENABLED_FROM_SYNC_UNKNOWN);
69
56 ChromeBrowserMainParts::PostProfileInit(); 70 ChromeBrowserMainParts::PostProfileInit();
57 } 71 }
58 72
59 void ChromeBrowserMainPartsAndroid::PreEarlyInitialization() { 73 void ChromeBrowserMainPartsAndroid::PreEarlyInitialization() {
60 TRACE_EVENT0("startup", 74 TRACE_EVENT0("startup",
61 "ChromeBrowserMainPartsAndroid::PreEarlyInitialization") 75 "ChromeBrowserMainPartsAndroid::PreEarlyInitialization")
62 net::NetworkChangeNotifier::SetFactory( 76 net::NetworkChangeNotifier::SetFactory(
63 new net::NetworkChangeNotifierFactoryAndroid()); 77 new net::NetworkChangeNotifierFactoryAndroid());
64 78
65 content::Compositor::Initialize(); 79 content::Compositor::Initialize();
(...skipping 15 matching lines...) Expand all
81 "ChromeBrowserMainPartsAndroid::PreEarlyInitialization:StartUiMsgLoop"); 95 "ChromeBrowserMainPartsAndroid::PreEarlyInitialization:StartUiMsgLoop");
82 base::MessageLoopForUI::current()->Start(); 96 base::MessageLoopForUI::current()->Start();
83 } 97 }
84 98
85 ChromeBrowserMainParts::PreEarlyInitialization(); 99 ChromeBrowserMainParts::PreEarlyInitialization();
86 } 100 }
87 101
88 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() { 102 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() {
89 NOTREACHED(); 103 NOTREACHED();
90 } 104 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698