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

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

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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/ui/chrome_pages.h" 5 #include "chrome/browser/ui/chrome_pages.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 break; 111 break;
112 case HELP_SOURCE_MENU: 112 case HELP_SOURCE_MENU:
113 url = GURL(kChromeHelpViaMenuURL); 113 url = GURL(kChromeHelpViaMenuURL);
114 break; 114 break;
115 case HELP_SOURCE_WEBUI: 115 case HELP_SOURCE_WEBUI:
116 url = GURL(kChromeHelpViaWebUIURL); 116 url = GURL(kChromeHelpViaWebUIURL);
117 break; 117 break;
118 default: 118 default:
119 NOTREACHED() << "Unhandled help source " << source; 119 NOTREACHED() << "Unhandled help source " << source;
120 } 120 }
121 scoped_ptr<ScopedTabbedBrowserDisplayer> displayer; 121 std::unique_ptr<ScopedTabbedBrowserDisplayer> displayer;
122 if (!browser) { 122 if (!browser) {
123 displayer.reset(new ScopedTabbedBrowserDisplayer(profile)); 123 displayer.reset(new ScopedTabbedBrowserDisplayer(profile));
124 browser = displayer->browser(); 124 browser = displayer->browser();
125 } 125 }
126 ShowSingletonTab(browser, url); 126 ShowSingletonTab(browser, url);
127 #endif 127 #endif
128 } 128 }
129 129
130 std::string GenerateContentSettingsExceptionsSubPage(ContentSettingsType type) { 130 std::string GenerateContentSettingsExceptionsSubPage(ContentSettingsType type) {
131 return kContentSettingsExceptionsSubPage + std::string(kHashMark) + 131 return kContentSettingsExceptionsSubPage + std::string(kHashMark) +
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 void ShowBrowserSignin(Browser* browser, 346 void ShowBrowserSignin(Browser* browser,
347 signin_metrics::AccessPoint access_point) { 347 signin_metrics::AccessPoint access_point) {
348 Profile* original_profile = browser->profile()->GetOriginalProfile(); 348 Profile* original_profile = browser->profile()->GetOriginalProfile();
349 SigninManagerBase* manager = 349 SigninManagerBase* manager =
350 SigninManagerFactory::GetForProfile(original_profile); 350 SigninManagerFactory::GetForProfile(original_profile);
351 DCHECK(manager->IsSigninAllowed()); 351 DCHECK(manager->IsSigninAllowed());
352 // If the browser's profile is an incognito profile, make sure to use 352 // If the browser's profile is an incognito profile, make sure to use
353 // a browser window from the original profile. The user cannot sign in 353 // a browser window from the original profile. The user cannot sign in
354 // from an incognito window. 354 // from an incognito window.
355 bool switched_browser = false; 355 bool switched_browser = false;
356 scoped_ptr<ScopedTabbedBrowserDisplayer> displayer; 356 std::unique_ptr<ScopedTabbedBrowserDisplayer> displayer;
357 if (browser->profile()->IsOffTheRecord()) { 357 if (browser->profile()->IsOffTheRecord()) {
358 switched_browser = true; 358 switched_browser = true;
359 displayer.reset(new ScopedTabbedBrowserDisplayer(original_profile)); 359 displayer.reset(new ScopedTabbedBrowserDisplayer(original_profile));
360 browser = displayer->browser(); 360 browser = displayer->browser();
361 } 361 }
362 362
363 // Since the extension is a separate application, it might steal focus 363 // Since the extension is a separate application, it might steal focus
364 // away from Chrome, and accidentally close the avatar bubble. The same will 364 // away from Chrome, and accidentally close the avatar bubble. The same will
365 // happen if we had to switch browser windows to show the sign in page. In 365 // happen if we had to switch browser windows to show the sign in page. In
366 // this case, fallback to the full-tab signin page. 366 // this case, fallback to the full-tab signin page.
(...skipping 26 matching lines...) Expand all
393 SigninManagerFactory::GetForProfile(original_profile); 393 SigninManagerFactory::GetForProfile(original_profile);
394 DCHECK(manager->IsSigninAllowed()); 394 DCHECK(manager->IsSigninAllowed());
395 if (manager->IsAuthenticated()) 395 if (manager->IsAuthenticated())
396 ShowSettings(browser); 396 ShowSettings(browser);
397 else 397 else
398 ShowBrowserSignin(browser, access_point); 398 ShowBrowserSignin(browser, access_point);
399 } 399 }
400 #endif 400 #endif
401 401
402 } // namespace chrome 402 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/chrome_bubble_manager_unittest.cc ('k') | chrome/browser/ui/chrome_select_file_policy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698