| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/tab_contents.h" | 5 #include "chrome/browser/tab_contents.h" |
| 6 | 6 |
| 7 #include "chrome/browser/cert_store.h" | 7 #include "chrome/browser/cert_store.h" |
| 8 #include "chrome/browser/navigation_entry.h" | 8 #include "chrome/browser/navigation_entry.h" |
| 9 #include "chrome/browser/views/download_shelf_view.h" | 9 #include "chrome/browser/views/download_shelf_view.h" |
| 10 #include "chrome/browser/views/download_started_animation.h" | 10 #include "chrome/browser/views/download_started_animation.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 NotificationService::current()->Notify(NOTIFY_TAB_CONTENTS_HIDDEN, | 235 NotificationService::current()->Notify(NOTIFY_TAB_CONTENTS_HIDDEN, |
| 236 Source<TabContents>(this), | 236 Source<TabContents>(this), |
| 237 NotificationService::NoDetails()); | 237 NotificationService::NoDetails()); |
| 238 } | 238 } |
| 239 | 239 |
| 240 void TabContents::Activate() { | 240 void TabContents::Activate() { |
| 241 if (delegate_) | 241 if (delegate_) |
| 242 delegate_->ActivateContents(this); | 242 delegate_->ActivateContents(this); |
| 243 } | 243 } |
| 244 | 244 |
| 245 void TabContents::OpenURL(const GURL& url, | 245 void TabContents::OpenURL(const GURL& url, const GURL& referrer, |
| 246 WindowOpenDisposition disposition, | 246 WindowOpenDisposition disposition, |
| 247 PageTransition::Type transition) { | 247 PageTransition::Type transition) { |
| 248 if (delegate_) | 248 if (delegate_) |
| 249 delegate_->OpenURLFromTab(this, url, disposition, transition); | 249 delegate_->OpenURLFromTab(this, url, referrer, disposition, transition); |
| 250 } | 250 } |
| 251 | 251 |
| 252 bool TabContents::NavigateToPendingEntry(bool reload) { | 252 bool TabContents::NavigateToPendingEntry(bool reload) { |
| 253 // Our benavior is just to report that the entry was committed. | 253 // Our benavior is just to report that the entry was committed. |
| 254 controller()->GetPendingEntry()->set_title(GetDefaultTitle()); | 254 controller()->GetPendingEntry()->set_title(GetDefaultTitle()); |
| 255 controller()->CommitPendingEntry(); | 255 controller()->CommitPendingEntry(); |
| 256 return true; | 256 return true; |
| 257 } | 257 } |
| 258 | 258 |
| 259 ConstrainedWindow* TabContents::CreateConstrainedDialog( | 259 ConstrainedWindow* TabContents::CreateConstrainedDialog( |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 void TabContents::AddNewContents(ConstrainedWindow* window, | 447 void TabContents::AddNewContents(ConstrainedWindow* window, |
| 448 TabContents* new_contents, | 448 TabContents* new_contents, |
| 449 WindowOpenDisposition disposition, | 449 WindowOpenDisposition disposition, |
| 450 const gfx::Rect& initial_pos, | 450 const gfx::Rect& initial_pos, |
| 451 bool user_gesture) { | 451 bool user_gesture) { |
| 452 AddNewContents(new_contents, disposition, initial_pos, user_gesture); | 452 AddNewContents(new_contents, disposition, initial_pos, user_gesture); |
| 453 } | 453 } |
| 454 | 454 |
| 455 void TabContents::OpenURL(ConstrainedWindow* window, | 455 void TabContents::OpenURL(ConstrainedWindow* window, |
| 456 const GURL& url, | 456 const GURL& url, |
| 457 const GURL& referrer, |
| 457 WindowOpenDisposition disposition, | 458 WindowOpenDisposition disposition, |
| 458 PageTransition::Type transition) { | 459 PageTransition::Type transition) { |
| 459 OpenURL(url, disposition, transition); | 460 OpenURL(url, referrer, disposition, transition); |
| 460 } | 461 } |
| 461 | 462 |
| 462 void TabContents::WillClose(ConstrainedWindow* window) { | 463 void TabContents::WillClose(ConstrainedWindow* window) { |
| 463 ConstrainedWindowList::iterator it = | 464 ConstrainedWindowList::iterator it = |
| 464 find(child_windows_.begin(), child_windows_.end(), window); | 465 find(child_windows_.begin(), child_windows_.end(), window); |
| 465 if (it != child_windows_.end()) | 466 if (it != child_windows_.end()) |
| 466 child_windows_.erase(it); | 467 child_windows_.erase(it); |
| 467 | 468 |
| 468 if (::IsWindow(GetContainerHWND())) { | 469 if (::IsWindow(GetContainerHWND())) { |
| 469 CRect client_rect; | 470 CRect client_rect; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 for (int i = window_count - 1; i >= 0; --i) { | 536 for (int i = window_count - 1; i >= 0; --i) { |
| 536 ConstrainedWindow* window = child_windows_.at(i); | 537 ConstrainedWindow* window = child_windows_.at(i); |
| 537 if (window->IsSuppressedConstrainedWindow()) | 538 if (window->IsSuppressedConstrainedWindow()) |
| 538 window->RepositionConstrainedWindowTo(anchor_position); | 539 window->RepositionConstrainedWindowTo(anchor_position); |
| 539 } | 540 } |
| 540 } | 541 } |
| 541 | 542 |
| 542 void TabContents::ReleaseDownloadShelfView() { | 543 void TabContents::ReleaseDownloadShelfView() { |
| 543 download_shelf_view_.release(); | 544 download_shelf_view_.release(); |
| 544 } | 545 } |
| OLD | NEW |