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

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

Issue 2858073002: Use constexpr TaskTraits constructor in chrome. (Closed)
Patch Set: Created 3 years, 7 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/views/outdated_upgrade_bubble_view.h" 5 #include "chrome/browser/ui/views/outdated_upgrade_bubble_view.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "base/metrics/user_metrics.h" 8 #include "base/metrics/user_metrics.h"
9 #include "base/task_scheduler/post_task.h" 9 #include "base/task_scheduler/post_task.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 base::UserMetricsAction("OutdatedUpgradeBubble.EnableAU")); 129 base::UserMetricsAction("OutdatedUpgradeBubble.EnableAU"));
130 // Record that the autoupdate flavour of the dialog has been shown. 130 // Record that the autoupdate flavour of the dialog has been shown.
131 if (g_browser_process->local_state()) { 131 if (g_browser_process->local_state()) {
132 g_browser_process->local_state()->SetBoolean( 132 g_browser_process->local_state()->SetBoolean(
133 prefs::kAttemptedToEnableAutoupdate, true); 133 prefs::kAttemptedToEnableAutoupdate, true);
134 } 134 }
135 135
136 // Re-enable updates by shelling out to setup.exe asynchronously. 136 // Re-enable updates by shelling out to setup.exe asynchronously.
137 base::PostTaskWithTraits( 137 base::PostTaskWithTraits(
138 FROM_HERE, 138 FROM_HERE,
139 base::TaskTraits() 139 {base::MayBlock(), base::TaskPriority::BACKGROUND,
140 .MayBlock() 140 base::TaskShutdownBehavior::BLOCK_SHUTDOWN},
141 .WithPriority(base::TaskPriority::BACKGROUND)
142 .WithShutdownBehavior(base::TaskShutdownBehavior::BLOCK_SHUTDOWN),
143 base::Bind(&google_update::ElevateIfNeededToReenableUpdates)); 141 base::Bind(&google_update::ElevateIfNeededToReenableUpdates));
144 #endif // defined(OS_WIN) 142 #endif // defined(OS_WIN)
145 } 143 }
146 144
147 return true; 145 return true;
148 } 146 }
149 147
150 void OutdatedUpgradeBubbleView::UpdateButton(views::LabelButton* button, 148 void OutdatedUpgradeBubbleView::UpdateButton(views::LabelButton* button,
151 ui::DialogButton type) { 149 ui::DialogButton type) {
152 BubbleDialogDelegateView::UpdateButton(button, type); 150 BubbleDialogDelegateView::UpdateButton(button, type);
(...skipping 28 matching lines...) Expand all
181 content::PageNavigator* navigator, 179 content::PageNavigator* navigator,
182 bool auto_update_enabled) 180 bool auto_update_enabled)
183 : BubbleDialogDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), 181 : BubbleDialogDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT),
184 auto_update_enabled_(auto_update_enabled), 182 auto_update_enabled_(auto_update_enabled),
185 navigator_(navigator) { 183 navigator_(navigator) {
186 // Compensate for built-in vertical padding in the anchor view's image. 184 // Compensate for built-in vertical padding in the anchor view's image.
187 set_anchor_view_insets(gfx::Insets( 185 set_anchor_view_insets(gfx::Insets(
188 GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0)); 186 GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0));
189 chrome::RecordDialogCreation(chrome::DialogIdentifier::OUTDATED_UPGRADE); 187 chrome::RecordDialogCreation(chrome::DialogIdentifier::OUTDATED_UPGRADE);
190 } 188 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/taskbar_decorator_win.cc ('k') | chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698