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

Side by Side Diff: chrome/browser/extensions/browser_extension_window_controller.cc

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header 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/extensions/browser_extension_window_controller.h" 5 #include "chrome/browser/extensions/browser_extension_window_controller.h"
6 6
7 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" 7 #include "chrome/browser/extensions/api/tabs/tabs_constants.h"
8 #include "chrome/browser/extensions/extension_tab_util.h" 8 #include "chrome/browser/extensions/extension_tab_util.h"
9 #include "chrome/browser/extensions/window_controller_list.h" 9 #include "chrome/browser/extensions/window_controller_list.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 const extensions::Extension* extension, int tab_index) const { 63 const extensions::Extension* extension, int tab_index) const {
64 TabStripModel* tab_strip = browser_->tab_strip_model(); 64 TabStripModel* tab_strip = browser_->tab_strip_model();
65 base::DictionaryValue* result = 65 base::DictionaryValue* result =
66 extensions::ExtensionTabUtil::CreateTabObject( 66 extensions::ExtensionTabUtil::CreateTabObject(
67 tab_strip->GetWebContentsAt(tab_index), tab_strip, tab_index) 67 tab_strip->GetWebContentsAt(tab_index), tab_strip, tab_index)
68 ->ToValue() 68 ->ToValue()
69 .release(); 69 .release();
70 return result; 70 return result;
71 } 71 }
72 72
73 scoped_ptr<extensions::api::tabs::Tab> 73 std::unique_ptr<extensions::api::tabs::Tab>
74 BrowserExtensionWindowController::CreateTabObject( 74 BrowserExtensionWindowController::CreateTabObject(
75 const extensions::Extension* extension, 75 const extensions::Extension* extension,
76 int tab_index) const { 76 int tab_index) const {
77 TabStripModel* tab_strip = browser_->tab_strip_model(); 77 TabStripModel* tab_strip = browser_->tab_strip_model();
78 return extensions::ExtensionTabUtil::CreateTabObject( 78 return extensions::ExtensionTabUtil::CreateTabObject(
79 tab_strip->GetWebContentsAt(tab_index), tab_strip, tab_index); 79 tab_strip->GetWebContentsAt(tab_index), tab_strip, tab_index);
80 } 80 }
81 81
82 bool BrowserExtensionWindowController::CanClose(Reason* reason) const { 82 bool BrowserExtensionWindowController::CanClose(Reason* reason) const {
83 // Don't let an extension remove the window if the user is dragging tabs 83 // Don't let an extension remove the window if the user is dragging tabs
(...skipping 15 matching lines...) Expand all
99 Browser* BrowserExtensionWindowController::GetBrowser() const { 99 Browser* BrowserExtensionWindowController::GetBrowser() const {
100 return browser_; 100 return browser_;
101 } 101 }
102 102
103 bool BrowserExtensionWindowController::IsVisibleToExtension( 103 bool BrowserExtensionWindowController::IsVisibleToExtension(
104 const extensions::Extension* extension) const { 104 const extensions::Extension* extension) const {
105 DCHECK(extension); 105 DCHECK(extension);
106 // Platform apps can only see their own windows. 106 // Platform apps can only see their own windows.
107 return !browser_->is_devtools() && !extension->is_platform_app(); 107 return !browser_->is_devtools() && !extension->is_platform_app();
108 } 108 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/browser_extension_window_controller.h ('k') | chrome/browser/extensions/bundle_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698