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

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

Issue 1803143002: Replace BrowserProces::AddRefModule/RemoveModule by ScopedKeepAlive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 9 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
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_list.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/ui/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 #include "chrome/browser/extensions/extension_service.h" 55 #include "chrome/browser/extensions/extension_service.h"
56 #include "chrome/browser/extensions/extension_ui_util.h" 56 #include "chrome/browser/extensions/extension_ui_util.h"
57 #include "chrome/browser/extensions/extension_util.h" 57 #include "chrome/browser/extensions/extension_util.h"
58 #include "chrome/browser/extensions/tab_helper.h" 58 #include "chrome/browser/extensions/tab_helper.h"
59 #include "chrome/browser/file_select_helper.h" 59 #include "chrome/browser/file_select_helper.h"
60 #include "chrome/browser/first_run/first_run.h" 60 #include "chrome/browser/first_run/first_run.h"
61 #include "chrome/browser/history/top_sites_factory.h" 61 #include "chrome/browser/history/top_sites_factory.h"
62 #include "chrome/browser/infobars/infobar_service.h" 62 #include "chrome/browser/infobars/infobar_service.h"
63 #include "chrome/browser/lifetime/application_lifetime.h" 63 #include "chrome/browser/lifetime/application_lifetime.h"
64 #include "chrome/browser/lifetime/keep_alive_registry.h" 64 #include "chrome/browser/lifetime/keep_alive_registry.h"
65 #include "chrome/browser/lifetime/keep_alive_types.h"
66 #include "chrome/browser/lifetime/scoped_keep_alive.h"
65 #include "chrome/browser/memory/tab_manager_web_contents_data.h" 67 #include "chrome/browser/memory/tab_manager_web_contents_data.h"
66 #include "chrome/browser/notifications/notification_ui_manager.h" 68 #include "chrome/browser/notifications/notification_ui_manager.h"
67 #include "chrome/browser/pepper_broker_infobar_delegate.h" 69 #include "chrome/browser/pepper_broker_infobar_delegate.h"
68 #include "chrome/browser/prefs/incognito_mode_prefs.h" 70 #include "chrome/browser/prefs/incognito_mode_prefs.h"
69 #include "chrome/browser/profiles/profile.h" 71 #include "chrome/browser/profiles/profile.h"
70 #include "chrome/browser/profiles/profile_destroyer.h" 72 #include "chrome/browser/profiles/profile_destroyer.h"
71 #include "chrome/browser/profiles/profile_metrics.h" 73 #include "chrome/browser/profiles/profile_metrics.h"
72 #include "chrome/browser/profiles/profiles_state.h" 74 #include "chrome/browser/profiles/profiles_state.h"
73 #include "chrome/browser/repost_form_warning_controller.h" 75 #include "chrome/browser/repost_form_warning_controller.h"
74 #include "chrome/browser/search/search.h" 76 #include "chrome/browser/search/search.h"
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 } 940 }
939 941
940 void Browser::CloseModalSigninWindow() { 942 void Browser::CloseModalSigninWindow() {
941 signin_view_controller_.CloseModalSignin(); 943 signin_view_controller_.CloseModalSignin();
942 } 944 }
943 945
944 void Browser::ShowModalSyncConfirmationWindow() { 946 void Browser::ShowModalSyncConfirmationWindow() {
945 signin_view_controller_.ShowModalSyncConfirmationDialog(this); 947 signin_view_controller_.ShowModalSyncConfirmationDialog(this);
946 } 948 }
947 949
950 void Browser::RegisterKeepAlive() {
951 keep_alive_.reset(new ScopedKeepAlive(KeepAliveOrigin::BROWSER,
952 KeepAliveRestartOption::DISABLED));
953 }
954 void Browser::UnregisterKeepAlive() {
955 keep_alive_.reset();
956 }
957
948 /////////////////////////////////////////////////////////////////////////////// 958 ///////////////////////////////////////////////////////////////////////////////
949 // Browser, PageNavigator implementation: 959 // Browser, PageNavigator implementation:
950 960
951 WebContents* Browser::OpenURL(const OpenURLParams& params) { 961 WebContents* Browser::OpenURL(const OpenURLParams& params) {
952 return OpenURLFromTab(NULL, params); 962 return OpenURLFromTab(NULL, params);
953 } 963 }
954 964
955 /////////////////////////////////////////////////////////////////////////////// 965 ///////////////////////////////////////////////////////////////////////////////
956 // Browser, TabStripModelObserver implementation: 966 // Browser, TabStripModelObserver implementation:
957 967
(...skipping 1779 matching lines...) Expand 10 before | Expand all | Expand 10 after
2737 if (contents && !allow_js_access) { 2747 if (contents && !allow_js_access) {
2738 contents->web_contents()->GetController().LoadURL( 2748 contents->web_contents()->GetController().LoadURL(
2739 target_url, 2749 target_url,
2740 content::Referrer(), 2750 content::Referrer(),
2741 ui::PAGE_TRANSITION_LINK, 2751 ui::PAGE_TRANSITION_LINK,
2742 std::string()); // No extra headers. 2752 std::string()); // No extra headers.
2743 } 2753 }
2744 2754
2745 return contents != NULL; 2755 return contents != NULL;
2746 } 2756 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698