OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/search/instant_page.h" | 5 #include "chrome/browser/ui/search/instant_page.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/common/render_messages.h" | 8 #include "chrome/common/render_messages.h" |
9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
11 #include "ui/base/resource/resource_bundle.h" | 11 #include "ui/base/resource/resource_bundle.h" |
12 #include "ui/gfx/font.h" | 12 #include "ui/gfx/font.h" |
13 | 13 |
14 InstantPage::Delegate::~Delegate() { | 14 InstantPage::Delegate::~Delegate() { |
15 } | 15 } |
16 | 16 |
17 InstantPage::~InstantPage() { | 17 InstantPage::~InstantPage() { |
18 } | 18 } |
19 | 19 |
20 bool InstantPage::IsLocalNTP() const { | 20 bool InstantPage::IsLocalNTP() const { |
21 return contents() && | 21 return contents() && |
22 contents()->GetURL() == GURL(chrome::kChromeSearchLocalNtpUrl); | 22 (contents()->GetURL() == GURL(chrome::kChromeSearchLocalNtpUrl) || |
| 23 contents()->GetURL() == GURL(chrome::kChromeSearchLocalGoogleNtpUrl)); |
23 } | 24 } |
24 | 25 |
25 bool InstantPage::IsLocalOverlay() const { | 26 bool InstantPage::IsLocalOverlay() const { |
26 return contents() && | 27 return contents() && |
27 contents()->GetURL() == GURL(chrome::kChromeSearchLocalOmniboxPopupURL); | 28 contents()->GetURL() == GURL(chrome::kChromeSearchLocalOmniboxPopupURL); |
28 } | 29 } |
29 | 30 |
30 void InstantPage::Update(const string16& text, | 31 void InstantPage::Update(const string16& text, |
31 size_t selection_start, | 32 size_t selection_start, |
32 size_t selection_end, | 33 size_t selection_end, |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 delegate_->DeleteMostVisitedItem(restricted_id); | 255 delegate_->DeleteMostVisitedItem(restricted_id); |
255 } | 256 } |
256 | 257 |
257 void InstantPage::OnUndoMostVisitedDeletion(InstantRestrictedID restricted_id) { | 258 void InstantPage::OnUndoMostVisitedDeletion(InstantRestrictedID restricted_id) { |
258 delegate_->UndoMostVisitedDeletion(restricted_id); | 259 delegate_->UndoMostVisitedDeletion(restricted_id); |
259 } | 260 } |
260 | 261 |
261 void InstantPage::OnUndoAllMostVisitedDeletions() { | 262 void InstantPage::OnUndoAllMostVisitedDeletions() { |
262 delegate_->UndoAllMostVisitedDeletions(); | 263 delegate_->UndoAllMostVisitedDeletions(); |
263 } | 264 } |
OLD | NEW |