OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser.h" | 5 #include "chrome/browser/browser.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "app/animation.h" | 10 #include "app/animation.h" |
(...skipping 2066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2077 BookmarkModel* model = profile()->GetBookmarkModel(); | 2077 BookmarkModel* model = profile()->GetBookmarkModel(); |
2078 DCHECK(model && model->IsLoaded()); | 2078 DCHECK(model && model->IsLoaded()); |
2079 | 2079 |
2080 BookmarkEditor::EditDetails details; | 2080 BookmarkEditor::EditDetails details; |
2081 details.type = BookmarkEditor::EditDetails::NEW_FOLDER; | 2081 details.type = BookmarkEditor::EditDetails::NEW_FOLDER; |
2082 bookmark_utils::GetURLsForOpenTabs(this, &(details.urls)); | 2082 bookmark_utils::GetURLsForOpenTabs(this, &(details.urls)); |
2083 DCHECK(!details.urls.empty()); | 2083 DCHECK(!details.urls.empty()); |
2084 | 2084 |
2085 BookmarkEditor::Show(window()->GetNativeHandle(), profile_, | 2085 BookmarkEditor::Show(window()->GetNativeHandle(), profile_, |
2086 model->GetParentForNewNodes(), details, | 2086 model->GetParentForNewNodes(), details, |
2087 BookmarkEditor::SHOW_TREE, NULL); | 2087 BookmarkEditor::SHOW_TREE); |
2088 } | 2088 } |
2089 | 2089 |
2090 /////////////////////////////////////////////////////////////////////////////// | 2090 /////////////////////////////////////////////////////////////////////////////// |
2091 // Browser, TabStripModelObserver implementation: | 2091 // Browser, TabStripModelObserver implementation: |
2092 | 2092 |
2093 void Browser::TabInsertedAt(TabContents* contents, | 2093 void Browser::TabInsertedAt(TabContents* contents, |
2094 int index, | 2094 int index, |
2095 bool foreground) { | 2095 bool foreground) { |
2096 contents->set_delegate(this); | 2096 contents->set_delegate(this); |
2097 contents->controller().SetWindowID(session_id()); | 2097 contents->controller().SetWindowID(session_id()); |
(...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3556 if (TabHasUnloadListener(contents)) { | 3556 if (TabHasUnloadListener(contents)) { |
3557 // If the page has unload listeners, then we tell the renderer to fire | 3557 // If the page has unload listeners, then we tell the renderer to fire |
3558 // them. Once they have fired, we'll get a message back saying whether | 3558 // them. Once they have fired, we'll get a message back saying whether |
3559 // to proceed closing the page or not, which sends us back to this method | 3559 // to proceed closing the page or not, which sends us back to this method |
3560 // with the HasUnloadListener bit cleared. | 3560 // with the HasUnloadListener bit cleared. |
3561 contents->render_view_host()->FirePageBeforeUnload(false); | 3561 contents->render_view_host()->FirePageBeforeUnload(false); |
3562 return true; | 3562 return true; |
3563 } | 3563 } |
3564 return false; | 3564 return false; |
3565 } | 3565 } |
OLD | NEW |