OLD | NEW |
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/window_controller_list.h" | 5 #include "chrome/browser/extensions/window_controller_list.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "chrome/browser/extensions/api/tabs/windows_util.h" | 9 #include "chrome/browser/extensions/api/tabs/windows_util.h" |
10 #include "chrome/browser/extensions/chrome_extension_function_details.h" | 10 #include "chrome/browser/extensions/chrome_extension_function_details.h" |
11 #include "chrome/browser/extensions/window_controller_list_observer.h" | 11 #include "chrome/browser/extensions/window_controller_list_observer.h" |
12 #include "chrome/common/extensions/api/windows.h" | 12 #include "chrome/common/extensions/api/windows.h" |
13 #include "components/sessions/session_id.h" | 13 #include "components/sessions/session_id.h" |
14 #include "extensions/browser/extension_function.h" | 14 #include "extensions/browser/extension_function.h" |
15 #include "ui/base/base_window.h" | 15 #include "ui/base/base_window.h" |
16 | 16 |
17 namespace extensions { | 17 namespace extensions { |
18 | 18 |
19 /////////////////////////////////////////////////////////////////////////////// | 19 /////////////////////////////////////////////////////////////////////////////// |
20 // WindowControllerList | 20 // WindowControllerList |
21 | 21 |
22 // static | 22 // static |
23 WindowControllerList* WindowControllerList::GetInstance() { | 23 WindowControllerList* WindowControllerList::GetInstance() { |
24 return Singleton<WindowControllerList>::get(); | 24 return base::Singleton<WindowControllerList>::get(); |
25 } | 25 } |
26 | 26 |
27 WindowControllerList::WindowControllerList() { | 27 WindowControllerList::WindowControllerList() { |
28 } | 28 } |
29 | 29 |
30 WindowControllerList::~WindowControllerList() { | 30 WindowControllerList::~WindowControllerList() { |
31 } | 31 } |
32 | 32 |
33 void WindowControllerList::AddExtensionWindow(WindowController* window) { | 33 void WindowControllerList::AddExtensionWindow(WindowController* window) { |
34 windows_.push_back(window); | 34 windows_.push_back(window); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 if (windows_util::CanOperateOnWindow(function, *iter, filter)) { | 101 if (windows_util::CanOperateOnWindow(function, *iter, filter)) { |
102 result = *iter; | 102 result = *iter; |
103 if (result->window()->IsActive()) | 103 if (result->window()->IsActive()) |
104 break; // use focused window | 104 break; // use focused window |
105 } | 105 } |
106 } | 106 } |
107 return result; | 107 return result; |
108 } | 108 } |
109 | 109 |
110 } // namespace extensions | 110 } // namespace extensions |
OLD | NEW |