Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3228)

Unified Diff: chrome/browser/tab_contents_wrapper.cc

Issue 5582002: Move:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/tab_contents_wrapper.h ('k') | chrome/browser/tab_menu_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents_wrapper.cc
===================================================================
--- chrome/browser/tab_contents_wrapper.cc (revision 68008)
+++ chrome/browser/tab_contents_wrapper.cc (working copy)
@@ -1,63 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/tab_contents_wrapper.h"
-
-#include "base/singleton.h"
-#include "chrome/browser/password_manager/password_manager.h"
-#include "chrome/browser/password_manager_delegate_impl.h"
-#include "chrome/browser/tab_contents/tab_contents.h"
-
-////////////////////////////////////////////////////////////////////////////////
-// TabContentsWrapper, public:
-
-TabContentsWrapper::TabContentsWrapper(TabContents* contents)
- : tab_contents_(contents) {
- DCHECK(contents);
- // Stash this in the property bag so it can be retrieved without having to
- // go to a Browser.
- property_accessor()->SetProperty(contents->property_bag(), this);
-
- // Needed so that we initialize the password manager on first navigation.
- tab_contents()->AddNavigationObserver(this);
-}
-
-TabContentsWrapper::~TabContentsWrapper() {
- // Unregister observers (TabContents outlives supporting objects).
- tab_contents()->RemoveNavigationObserver(password_manager_.get());
-}
-
-PropertyAccessor<TabContentsWrapper*>* TabContentsWrapper::property_accessor() {
- return Singleton< PropertyAccessor<TabContentsWrapper*> >::get();
-}
-
-TabContentsWrapper* TabContentsWrapper::Clone() {
- TabContents* new_contents = tab_contents()->Clone();
- TabContentsWrapper* new_wrapper = new TabContentsWrapper(new_contents);
- // Instantiate the passowrd manager if it has been instantiated here.
- if (password_manager_.get())
- new_wrapper->GetPasswordManager();
- return new_wrapper;
-}
-
-PasswordManager* TabContentsWrapper::GetPasswordManager() {
- if (!password_manager_.get()) {
- // Create the delegate then create the manager.
- password_manager_delegate_.reset(
- new PasswordManagerDelegateImpl(tab_contents()));
- password_manager_.reset(
- new PasswordManager(password_manager_delegate_.get()));
- // Register the manager to receive navigation notifications.
- tab_contents()->AddNavigationObserver(password_manager_.get());
- }
- return password_manager_.get();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// TabContentsWrapper, WebNavigationObserver implementation:
-
-void TabContentsWrapper::NavigateToPendingEntry() {
- GetPasswordManager();
- tab_contents()->RemoveNavigationObserver(this);
-}
« no previous file with comments | « chrome/browser/tab_contents_wrapper.h ('k') | chrome/browser/tab_menu_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698