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

Unified Diff: chrome/browser/tab_contents/web_contents.cc

Issue 67066: Prepopulate the Find box with whatever was searched for last (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 8 months 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
Index: chrome/browser/tab_contents/web_contents.cc
===================================================================
--- chrome/browser/tab_contents/web_contents.cc (revision 13523)
+++ chrome/browser/tab_contents/web_contents.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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.
@@ -208,7 +208,8 @@
load_state_(net::LOAD_STATE_IDLE),
find_ui_active_(false),
find_op_aborted_(false),
- current_find_request_id_(find_request_id_counter_++) {
+ current_find_request_id_(find_request_id_counter_++),
+ find_prepopulate_text_(NULL) {
pending_install_.page_id = 0;
pending_install_.callback_functor = NULL;
@@ -232,6 +233,10 @@
NotificationService::current()->AddObserver(
this, NotificationType::RENDER_WIDGET_HOST_DESTROYED,
NotificationService::AllSources());
+
+ // Keep a global copy of the previous search string (if any).
+ static string16 global_last_search = string16();
+ find_prepopulate_text_ = &global_last_search;
Ben Goodger (Google) 2009/04/13 20:48:25 is there a reason to save a pointer to this rather
}
WebContents::~WebContents() {
@@ -625,6 +630,9 @@
find_op_aborted_ = false;
+ // Keep track of what the last search was across the tabs.
+ *find_prepopulate_text_ = find_text;
+
render_view_host()->StartFinding(current_find_request_id_,
find_text_,
forward_direction,
« chrome/browser/find_bar_controller.cc ('K') | « chrome/browser/tab_contents/web_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698