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

Side by Side Diff: chrome/browser/instant/instant_controller.cc

Issue 8892011: Clean up TCW, make it solely a hub for 1:1 observer/helper objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/instant/instant_controller.h" 5 #include "chrome/browser/instant/instant_controller.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.h" 9 #include "base/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 string16 suggested_text; 262 string16 suggested_text;
263 UpdateLoader(template_url, last_url_, last_transition_type_, last_user_text_, 263 UpdateLoader(template_url, last_url_, last_transition_type_, last_user_text_,
264 true, &suggested_text); 264 true, &suggested_text);
265 return true; 265 return true;
266 } 266 }
267 267
268 TabContentsWrapper* InstantController::CommitCurrentPreview( 268 TabContentsWrapper* InstantController::CommitCurrentPreview(
269 InstantCommitType type) { 269 InstantCommitType type) {
270 DCHECK(loader_.get()); 270 DCHECK(loader_.get());
271 TabContentsWrapper* tab = ReleasePreviewContents(type); 271 TabContentsWrapper* tab = ReleasePreviewContents(type);
272 tab->controller().CopyStateFromAndPrune(&tab_contents_->controller()); 272 tab->tab_contents()->controller().CopyStateFromAndPrune(
273 &tab_contents_->tab_contents()->controller());
273 delegate_->CommitInstant(tab); 274 delegate_->CommitInstant(tab);
274 CompleteRelease(tab); 275 CompleteRelease(tab);
275 return tab; 276 return tab;
276 } 277 }
277 278
278 void InstantController::SetCommitOnMouseUp() { 279 void InstantController::SetCommitOnMouseUp() {
279 commit_on_mouse_up_ = true; 280 commit_on_mouse_up_ = true;
280 } 281 }
281 282
282 bool InstantController::IsMouseDownFromActivate() { 283 bool InstantController::IsMouseDownFromActivate() {
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 if (!weak_factory_.HasWeakPtrs()) { 555 if (!weak_factory_.HasWeakPtrs()) {
555 MessageLoop::current()->PostTask( 556 MessageLoop::current()->PostTask(
556 FROM_HERE, base::Bind(&InstantController::DestroyLoaders, 557 FROM_HERE, base::Bind(&InstantController::DestroyLoaders,
557 weak_factory_.GetWeakPtr())); 558 weak_factory_.GetWeakPtr()));
558 } 559 }
559 } 560 }
560 561
561 void InstantController::DestroyLoaders() { 562 void InstantController::DestroyLoaders() {
562 loaders_to_destroy_.reset(); 563 loaders_to_destroy_.reset();
563 } 564 }
OLDNEW
« no previous file with comments | « chrome/browser/geolocation/geolocation_browsertest.cc ('k') | chrome/browser/instant/instant_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698