| 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/ui/browser_tab_strip_model_delegate.h" | 5 #include "chrome/browser/ui/browser_tab_strip_model_delegate.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // the first web contents to be marked as active. | 70 // the first web contents to be marked as active. |
| 71 if (i == 0) | 71 if (i == 0) |
| 72 item.add_types |= TabStripModel::ADD_ACTIVE; | 72 item.add_types |= TabStripModel::ADD_ACTIVE; |
| 73 | 73 |
| 74 new_model->InsertWebContentsAt( | 74 new_model->InsertWebContentsAt( |
| 75 static_cast<int>(i), item.web_contents, item.add_types); | 75 static_cast<int>(i), item.web_contents, item.add_types); |
| 76 // Make sure the loading state is updated correctly, otherwise the throbber | 76 // Make sure the loading state is updated correctly, otherwise the throbber |
| 77 // won't start if the page is loading. | 77 // won't start if the page is loading. |
| 78 // TODO(beng): find a better way of doing this. | 78 // TODO(beng): find a better way of doing this. |
| 79 static_cast<content::WebContentsDelegate*>(browser)-> | 79 static_cast<content::WebContentsDelegate*>(browser)-> |
| 80 LoadingStateChanged(item.web_contents); | 80 LoadingStateChanged(item.web_contents, true); |
| 81 } | 81 } |
| 82 | 82 |
| 83 return browser; | 83 return browser; |
| 84 } | 84 } |
| 85 | 85 |
| 86 void BrowserTabStripModelDelegate::WillAddWebContents( | 86 void BrowserTabStripModelDelegate::WillAddWebContents( |
| 87 content::WebContents* contents) { | 87 content::WebContents* contents) { |
| 88 TabHelpers::AttachTabHelpers(contents); | 88 TabHelpers::AttachTabHelpers(contents); |
| 89 } | 89 } |
| 90 | 90 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 168 } |
| 169 | 169 |
| 170 //////////////////////////////////////////////////////////////////////////////// | 170 //////////////////////////////////////////////////////////////////////////////// |
| 171 // BrowserTabStripModelDelegate, private: | 171 // BrowserTabStripModelDelegate, private: |
| 172 | 172 |
| 173 void BrowserTabStripModelDelegate::CloseFrame() { | 173 void BrowserTabStripModelDelegate::CloseFrame() { |
| 174 browser_->window()->Close(); | 174 browser_->window()->Close(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 } // namespace chrome | 177 } // namespace chrome |
| OLD | NEW |