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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

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 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 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <numeric> 8 #include <numeric>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after
1575 [translateBubbleController_ switchToErrorView:errorType]; 1575 [translateBubbleController_ switchToErrorView:errorType];
1576 } 1576 }
1577 return; 1577 return;
1578 } 1578 }
1579 1579
1580 std::string sourceLanguage; 1580 std::string sourceLanguage;
1581 std::string targetLanguage; 1581 std::string targetLanguage;
1582 ChromeTranslateClient::GetTranslateLanguages( 1582 ChromeTranslateClient::GetTranslateLanguages(
1583 contents, &sourceLanguage, &targetLanguage); 1583 contents, &sourceLanguage, &targetLanguage);
1584 1584
1585 scoped_ptr<translate::TranslateUIDelegate> uiDelegate( 1585 std::unique_ptr<translate::TranslateUIDelegate> uiDelegate(
1586 new translate::TranslateUIDelegate( 1586 new translate::TranslateUIDelegate(
1587 ChromeTranslateClient::GetManagerFromWebContents(contents) 1587 ChromeTranslateClient::GetManagerFromWebContents(contents)
1588 ->GetWeakPtr(), 1588 ->GetWeakPtr(),
1589 sourceLanguage, 1589 sourceLanguage, targetLanguage));
1590 targetLanguage)); 1590 std::unique_ptr<TranslateBubbleModel> model(
1591 scoped_ptr<TranslateBubbleModel> model(
1592 new TranslateBubbleModelImpl(step, std::move(uiDelegate))); 1591 new TranslateBubbleModelImpl(step, std::move(uiDelegate)));
1593 translateBubbleController_ = 1592 translateBubbleController_ =
1594 [[TranslateBubbleController alloc] initWithParentWindow:self 1593 [[TranslateBubbleController alloc] initWithParentWindow:self
1595 model:std::move(model) 1594 model:std::move(model)
1596 webContents:contents]; 1595 webContents:contents];
1597 [translateBubbleController_ showWindow:nil]; 1596 [translateBubbleController_ showWindow:nil];
1598 1597
1599 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; 1598 NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
1600 [center addObserver:self 1599 [center addObserver:self
1601 selector:@selector(translateBubbleWindowWillClose:) 1600 selector:@selector(translateBubbleWindowWillClose:)
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
2047 2046
2048 - (BOOL)isTabbedWindow { 2047 - (BOOL)isTabbedWindow {
2049 return browser_->is_type_tabbed(); 2048 return browser_->is_type_tabbed();
2050 } 2049 }
2051 2050
2052 - (NSRect)savedRegularWindowFrame { 2051 - (NSRect)savedRegularWindowFrame {
2053 return savedRegularWindowFrame_; 2052 return savedRegularWindowFrame_;
2054 } 2053 }
2055 2054
2056 @end // @implementation BrowserWindowController(WindowType) 2055 @end // @implementation BrowserWindowController(WindowType)
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.h ('k') | chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698