OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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/profile.h" | 5 #include "chrome/browser/profiles/profile.h" |
6 #include "chrome/browser/ui/find_bar/find_bar_state.h" | 6 #include "chrome/browser/ui/find_bar/find_bar_state.h" |
7 | 7 |
8 // static | 8 // static |
9 string16 FindBarState::GetLastPrepopulateText(Profile* p) { | 9 string16 FindBarState::GetLastPrepopulateText(Profile* p) { |
10 FindBarState* state = p->GetFindBarState(); | 10 FindBarState* state = p->GetFindBarState(); |
11 string16 text = state->last_prepopulate_text(); | 11 string16 text = state->last_prepopulate_text(); |
12 | 12 |
13 if (text.empty() && p->IsOffTheRecord()) { | 13 if (text.empty() && p->IsOffTheRecord()) { |
14 // Fall back to the original profile. | 14 // Fall back to the original profile. |
15 state = p->GetOriginalProfile()->GetFindBarState(); | 15 state = p->GetOriginalProfile()->GetFindBarState(); |
16 text = state->last_prepopulate_text(); | 16 text = state->last_prepopulate_text(); |
17 } | 17 } |
18 | 18 |
19 return text; | 19 return text; |
20 } | 20 } |
OLD | NEW |