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

Side by Side Diff: chrome/browser/ui/search/instant_page.cc

Issue 13905008: Merge local_omnibox_popup into local_ntp. Render the Google logo and fakebox if Google is the sear… (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Delete local omnibox popup. Created 7 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 unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698