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 3 // found in the LICENSE file. 4 5 // Stores per-profile state needed for find in page. This includes the most 6 // recently searched for term. 7 8 #ifndef CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_STATE_H_ 9 #define CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_STATE_H_ 10 #pragma once 11 12 #include "base/basictypes.h" 13 #include "base/string16.h" 14 15 class Profile; 16 17 class FindBarState { 18 public: 19 FindBarState() {} 20 ~FindBarState() {} 21 22 string16 last_prepopulate_text() const { 23 return last_prepopulate_text_; 24 } 25 26 void set_last_prepopulate_text(const string16& text) { 27 last_prepopulate_text_ = text; 28 } 29 30 // Retrieves the last prepopulate text for a given Profile. If the profile is 31 // incognito and has an empty prepopulate text, falls back to the 32 // prepopulate text from the normal profile. 33 static string16 GetLastPrepopulateText(Profile* profile); 34 35 private: 36 string16 last_prepopulate_text_; 37 38 DISALLOW_COPY_AND_ASSIGN(FindBarState); 39 }; 40 41 #endif // CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_STATE_H_ 42