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 "content/shell/shell.h" | 5 #include "content/shell/shell.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 shell->web_contents_.reset(web_contents); | 65 shell->web_contents_.reset(web_contents); |
66 web_contents->SetDelegate(shell); | 66 web_contents->SetDelegate(shell); |
67 | 67 |
68 shell->PlatformSetContents(); | 68 shell->PlatformSetContents(); |
69 | 69 |
70 shell->PlatformResizeSubViews(); | 70 shell->PlatformResizeSubViews(); |
71 return shell; | 71 return shell; |
72 } | 72 } |
73 | 73 |
| 74 std::vector<Shell*> Shell::GetWindows() { |
| 75 return windows_; |
| 76 } |
| 77 |
74 void Shell::CloseAllWindows() { | 78 void Shell::CloseAllWindows() { |
75 AutoReset<bool> auto_reset(&quit_message_loop_, false); | 79 AutoReset<bool> auto_reset(&quit_message_loop_, false); |
76 std::vector<Shell*> open_windows(windows_); | 80 std::vector<Shell*> open_windows(windows_); |
77 for (size_t i = 0; i < open_windows.size(); ++i) | 81 for (size_t i = 0; i < open_windows.size(); ++i) |
78 open_windows[i]->Close(); | 82 open_windows[i]->Close(); |
79 MessageLoop::current()->RunAllPending(); | 83 MessageLoop::current()->RunAllPending(); |
80 } | 84 } |
81 | 85 |
82 Shell* Shell::FromRenderViewHost(RenderViewHost* rvh) { | 86 Shell* Shell::FromRenderViewHost(RenderViewHost* rvh) { |
83 for (size_t i = 0; i < windows_.size(); ++i) { | 87 for (size_t i = 0; i < windows_.size(); ++i) { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 Details<std::pair<NavigationEntry*, bool> >(details).ptr(); | 194 Details<std::pair<NavigationEntry*, bool> >(details).ptr(); |
191 | 195 |
192 if (title->first) { | 196 if (title->first) { |
193 string16 text = title->first->GetTitle(); | 197 string16 text = title->first->GetTitle(); |
194 PlatformSetTitle(text); | 198 PlatformSetTitle(text); |
195 } | 199 } |
196 } | 200 } |
197 } | 201 } |
198 | 202 |
199 } // namespace content | 203 } // namespace content |
OLD | NEW |