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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_edit_view_views.cc

Issue 6462009: Allow dragging and dropping of URLs to any portion of the toolbar view.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/autocomplete/autocomplete_edit_view_views.h" 5 #include "chrome/browser/autocomplete/autocomplete_edit_view_views.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
11 #include "chrome/browser/autocomplete/autocomplete_edit.h" 11 #include "chrome/browser/autocomplete/autocomplete_edit.h"
12 #include "chrome/browser/autocomplete/autocomplete_match.h" 12 #include "chrome/browser/autocomplete/autocomplete_match.h"
13 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" 13 #include "chrome/browser/autocomplete/autocomplete_popup_model.h"
14 #include "chrome/browser/command_updater.h" 14 #include "chrome/browser/command_updater.h"
15 #include "chrome/browser/tab_contents/tab_contents.h" 15 #include "chrome/browser/tab_contents/tab_contents.h"
16 #include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view. h" 16 #include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view. h"
17 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 17 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
18 #include "chrome/common/notification_service.h" 18 #include "chrome/common/notification_service.h"
19 #include "googleurl/src/gurl.h" 19 #include "googleurl/src/gurl.h"
20 #include "grit/generated_resources.h" 20 #include "grit/generated_resources.h"
21 #include "net/base/escape.h" 21 #include "net/base/escape.h"
22 #include "ui/base/dragdrop/drag_drop_types.h"
22 #include "ui/base/l10n/l10n_util.h" 23 #include "ui/base/l10n/l10n_util.h"
23 #include "ui/gfx/font.h" 24 #include "ui/gfx/font.h"
24 #include "views/border.h" 25 #include "views/border.h"
25 #include "views/layout/fill_layout.h" 26 #include "views/layout/fill_layout.h"
26 27
27 namespace { 28 namespace {
28 29
29 // Textfield for autocomplete that intercepts events that are necessary 30 // Textfield for autocomplete that intercepts events that are necessary
30 // for AutocompleteEditViewViews. 31 // for AutocompleteEditViewViews.
31 class AutocompleteTextfield : public views::Textfield { 32 class AutocompleteTextfield : public views::Textfield {
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 bool AutocompleteEditViewViews::IsImeComposing() const { 555 bool AutocompleteEditViewViews::IsImeComposing() const {
555 return false; 556 return false;
556 } 557 }
557 558
558 views::View* AutocompleteEditViewViews::AddToView(views::View* parent) { 559 views::View* AutocompleteEditViewViews::AddToView(views::View* parent) {
559 parent->AddChildView(this); 560 parent->AddChildView(this);
560 AddChildView(textfield_); 561 AddChildView(textfield_);
561 return this; 562 return this;
562 } 563 }
563 564
565 int AutocompleteEditViewViews::OnPerformDrop(
566 const views::DropTargetEvent& event) {
567 return ui::DragDropTypes::DRAG_NONE;
sky 2011/02/11 01:06:07 indent by 2, also add NOTIMPLEMENTED.
Roger Tawa OOO till Jul 10th 2011/02/11 15:20:17 Done.
568 }
569
564 //////////////////////////////////////////////////////////////////////////////// 570 ////////////////////////////////////////////////////////////////////////////////
565 // AutocompleteEditViewViews, NotificationObserver implementation: 571 // AutocompleteEditViewViews, NotificationObserver implementation:
566 572
567 void AutocompleteEditViewViews::Observe(NotificationType type, 573 void AutocompleteEditViewViews::Observe(NotificationType type,
568 const NotificationSource& source, 574 const NotificationSource& source,
569 const NotificationDetails& details) { 575 const NotificationDetails& details) {
570 DCHECK(type == NotificationType::BROWSER_THEME_CHANGED); 576 DCHECK(type == NotificationType::BROWSER_THEME_CHANGED);
571 SetBaseColor(); 577 SetBaseColor();
572 } 578 }
573 579
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 642
637 string16 AutocompleteEditViewViews::GetSelectedText() const { 643 string16 AutocompleteEditViewViews::GetSelectedText() const {
638 // TODO(oshima): Support instant, IME. 644 // TODO(oshima): Support instant, IME.
639 return textfield_->GetSelectedText(); 645 return textfield_->GetSelectedText();
640 } 646 }
641 647
642 void AutocompleteEditViewViews::SelectRange(size_t caret, size_t end) { 648 void AutocompleteEditViewViews::SelectRange(size_t caret, size_t end) {
643 const views::TextRange range(caret, end); 649 const views::TextRange range(caret, end);
644 textfield_->SelectRange(range); 650 textfield_->SelectRange(range);
645 } 651 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698