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

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

Issue 2323993004: Remove use of deprecated base::ListValue::Append(Value*) overload in extensions. (Closed)
Patch Set: ... I hate C++ Created 4 years, 3 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 BrowserExtensionWindowController::CreateWindowValueWithTabs( 45 BrowserExtensionWindowController::CreateWindowValueWithTabs(
46 const extensions::Extension* extension) const { 46 const extensions::Extension* extension) const {
47 std::unique_ptr<base::DictionaryValue> result = CreateWindowValue(); 47 std::unique_ptr<base::DictionaryValue> result = CreateWindowValue();
48 48
49 result->Set(keys::kTabsKey, 49 result->Set(keys::kTabsKey,
50 extensions::ExtensionTabUtil::CreateTabList(browser_, extension)); 50 extensions::ExtensionTabUtil::CreateTabList(browser_, extension));
51 51
52 return result; 52 return result;
53 } 53 }
54 54
55 base::DictionaryValue* BrowserExtensionWindowController::CreateTabValue(
56 const extensions::Extension* extension, int tab_index) const {
57 TabStripModel* tab_strip = browser_->tab_strip_model();
58 base::DictionaryValue* result =
59 extensions::ExtensionTabUtil::CreateTabObject(
60 tab_strip->GetWebContentsAt(tab_index), tab_strip, tab_index)
61 ->ToValue()
62 .release();
63 return result;
64 }
65
66 std::unique_ptr<extensions::api::tabs::Tab> 55 std::unique_ptr<extensions::api::tabs::Tab>
67 BrowserExtensionWindowController::CreateTabObject( 56 BrowserExtensionWindowController::CreateTabObject(
68 const extensions::Extension* extension, 57 const extensions::Extension* extension,
69 int tab_index) const { 58 int tab_index) const {
70 TabStripModel* tab_strip = browser_->tab_strip_model(); 59 TabStripModel* tab_strip = browser_->tab_strip_model();
71 return extensions::ExtensionTabUtil::CreateTabObject( 60 return extensions::ExtensionTabUtil::CreateTabObject(
72 tab_strip->GetWebContentsAt(tab_index), tab_strip, tab_index); 61 tab_strip->GetWebContentsAt(tab_index), tab_strip, tab_index);
73 } 62 }
74 63
75 bool BrowserExtensionWindowController::CanClose(Reason* reason) const { 64 bool BrowserExtensionWindowController::CanClose(Reason* reason) const {
(...skipping 16 matching lines...) Expand all
92 Browser* BrowserExtensionWindowController::GetBrowser() const { 81 Browser* BrowserExtensionWindowController::GetBrowser() const {
93 return browser_; 82 return browser_;
94 } 83 }
95 84
96 bool BrowserExtensionWindowController::IsVisibleToExtension( 85 bool BrowserExtensionWindowController::IsVisibleToExtension(
97 const extensions::Extension* extension) const { 86 const extensions::Extension* extension) const {
98 DCHECK(extension); 87 DCHECK(extension);
99 // Platform apps can only see their own windows. 88 // Platform apps can only see their own windows.
100 return !browser_->is_devtools() && !extension->is_platform_app(); 89 return !browser_->is_devtools() && !extension->is_platform_app();
101 } 90 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/browser_extension_window_controller.h ('k') | chrome/browser/extensions/menu_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698