| 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::IsLocal() const { |
| 21 return contents() && | 21 return contents() && |
| 22 contents()->GetURL() == GURL(chrome::kChromeSearchLocalNtpUrl); | 22 (contents()->GetURL() == GURL(chrome::kChromeSearchLocalNtpUrl) || |
| 23 } | 23 contents()->GetURL() == GURL(chrome::kChromeSearchLocalGoogleNtpUrl)); |
| 24 | |
| 25 bool InstantPage::IsLocalOverlay() const { | |
| 26 return contents() && | |
| 27 contents()->GetURL() == GURL(chrome::kChromeSearchLocalOmniboxPopupURL); | |
| 28 } | 24 } |
| 29 | 25 |
| 30 void InstantPage::Update(const string16& text, | 26 void InstantPage::Update(const string16& text, |
| 31 size_t selection_start, | 27 size_t selection_start, |
| 32 size_t selection_end, | 28 size_t selection_end, |
| 33 bool verbatim) { | 29 bool verbatim) { |
| 34 Send(new ChromeViewMsg_SearchBoxChange(routing_id(), text, verbatim, | 30 Send(new ChromeViewMsg_SearchBoxChange(routing_id(), text, verbatim, |
| 35 selection_start, selection_end)); | 31 selection_start, selection_end)); |
| 36 } | 32 } |
| 37 | 33 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 delegate_->DeleteMostVisitedItem(restricted_id); | 250 delegate_->DeleteMostVisitedItem(restricted_id); |
| 255 } | 251 } |
| 256 | 252 |
| 257 void InstantPage::OnUndoMostVisitedDeletion(InstantRestrictedID restricted_id) { | 253 void InstantPage::OnUndoMostVisitedDeletion(InstantRestrictedID restricted_id) { |
| 258 delegate_->UndoMostVisitedDeletion(restricted_id); | 254 delegate_->UndoMostVisitedDeletion(restricted_id); |
| 259 } | 255 } |
| 260 | 256 |
| 261 void InstantPage::OnUndoAllMostVisitedDeletions() { | 257 void InstantPage::OnUndoAllMostVisitedDeletions() { |
| 262 delegate_->UndoAllMostVisitedDeletions(); | 258 delegate_->UndoAllMostVisitedDeletions(); |
| 263 } | 259 } |
| OLD | NEW |