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

Side by Side Diff: chrome/browser/extensions/api/tabs/windows_util.cc

Issue 1099553002: extensions: windows: list all windows from the current profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add application windows resize constraint test Created 5 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/extensions/api/tabs/windows_util.h" 5 #include "chrome/browser/extensions/api/tabs/windows_util.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" 8 #include "chrome/browser/extensions/api/tabs/tabs_constants.h"
9 #include "chrome/browser/extensions/chrome_extension_function.h" 9 #include "chrome/browser/extensions/chrome_extension_function.h"
10 #include "chrome/browser/extensions/chrome_extension_function_details.h" 10 #include "chrome/browser/extensions/chrome_extension_function_details.h"
(...skipping 20 matching lines...) Expand all
31 *controller = extensions::WindowControllerList::GetInstance() 31 *controller = extensions::WindowControllerList::GetInstance()
32 ->CurrentWindowForFunction(function_details); 32 ->CurrentWindowForFunction(function_details);
33 } 33 }
34 if (!(*controller)) { 34 if (!(*controller)) {
35 function->SetError(extensions::tabs_constants::kNoCurrentWindowError); 35 function->SetError(extensions::tabs_constants::kNoCurrentWindowError);
36 return false; 36 return false;
37 } 37 }
38 } else { 38 } else {
39 *controller = extensions::WindowControllerList::GetInstance() 39 *controller = extensions::WindowControllerList::GetInstance()
40 ->FindWindowForFunctionById(function_details, window_id); 40 ->FindWindowForFunctionById(function_details, window_id);
41
41 if (!(*controller)) { 42 if (!(*controller)) {
42 function->SetError(extensions::ErrorUtils::FormatErrorMessage( 43 function->SetError(extensions::ErrorUtils::FormatErrorMessage(
43 extensions::tabs_constants::kWindowNotFoundError, 44 extensions::tabs_constants::kWindowNotFoundError,
44 base::IntToString(window_id))); 45 base::IntToString(window_id)));
45 return false; 46 return false;
46 } 47 }
47 } 48 }
48 return true; 49 return true;
49 } 50 }
50 51
51 } // namespace windows_util 52 } // namespace windows_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698