| OLD | NEW |
| 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/ui/views/frame/browser_root_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_root_view.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/autocomplete/autocomplete.h" | 8 #include "chrome/browser/autocomplete/autocomplete.h" |
| 9 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 9 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
| 10 #include "chrome/browser/autocomplete/autocomplete_match.h" | 10 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/ui/omnibox/location_bar.h" | 12 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 13 #include "chrome/browser/ui/views/frame/browser_frame.h" | 13 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| 14 #include "chrome/browser/ui/views/frame/browser_view.h" | 14 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 15 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 15 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 16 #include "grit/chromium_strings.h" | 16 #include "grit/chromium_strings.h" |
| 17 #include "ui/base/accessibility/accessible_view_state.h" | 17 #include "ui/base/accessibility/accessible_view_state.h" |
| 18 #include "ui/base/dragdrop/drag_drop_types.h" | 18 #include "ui/base/dragdrop/drag_drop_types.h" |
| 19 #include "ui/base/dragdrop/os_exchange_data.h" | 19 #include "ui/base/dragdrop/os_exchange_data.h" |
| 20 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
| 21 #if defined(TOUCH_UI) | 21 #if defined(TOUCH_UI) |
| 22 #include "content/common/content_notification_types.h" |
| 22 #include "content/common/notification_service.h" | 23 #include "content/common/notification_service.h" |
| 23 #include "content/common/notification_type.h" | |
| 24 #include "views/ime/input_method.h" | 24 #include "views/ime/input_method.h" |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 // static | 27 // static |
| 28 const char BrowserRootView::kViewClassName[] = | 28 const char BrowserRootView::kViewClassName[] = |
| 29 "browser/ui/views/frame/BrowserRootView"; | 29 "browser/ui/views/frame/BrowserRootView"; |
| 30 | 30 |
| 31 BrowserRootView::BrowserRootView(BrowserView* browser_view, | 31 BrowserRootView::BrowserRootView(BrowserView* browser_view, |
| 32 views::Widget* widget) | 32 views::Widget* widget) |
| 33 : views::internal::RootView(widget), | 33 : views::internal::RootView(widget), |
| 34 browser_view_(browser_view), | 34 browser_view_(browser_view), |
| 35 forwarding_to_tab_strip_(false) { } | 35 forwarding_to_tab_strip_(false) { } |
| 36 | 36 |
| 37 #if defined(TOUCH_UI) | 37 #if defined(TOUCH_UI) |
| 38 ui::TouchStatus BrowserRootView::OnTouchEvent(const views::TouchEvent& event) { | 38 ui::TouchStatus BrowserRootView::OnTouchEvent(const views::TouchEvent& event) { |
| 39 const ui::TouchStatus status = views::internal::RootView::OnTouchEvent(event); | 39 const ui::TouchStatus status = views::internal::RootView::OnTouchEvent(event); |
| 40 | 40 |
| 41 if (event.type() != ui::ET_TOUCH_PRESSED) | 41 if (event.type() != ui::ET_TOUCH_PRESSED) |
| 42 return status; | 42 return status; |
| 43 | 43 |
| 44 views::InputMethod* input_method = GetInputMethod(); | 44 views::InputMethod* input_method = GetInputMethod(); |
| 45 if (!input_method) | 45 if (!input_method) |
| 46 return status; | 46 return status; |
| 47 | 47 |
| 48 ui::TextInputType text_input_type = input_method->GetTextInputType(); | 48 ui::TextInputType text_input_type = input_method->GetTextInputType(); |
| 49 if (text_input_type != ui::TEXT_INPUT_TYPE_NONE) { | 49 if (text_input_type != ui::TEXT_INPUT_TYPE_NONE) { |
| 50 NotificationService::current()->Notify( | 50 NotificationService::current()->Notify( |
| 51 NotificationType::EDITABLE_ELEMENT_TOUCHED, | 51 chrome::EDITABLE_ELEMENT_TOUCHED, |
| 52 Source<View>(this), | 52 Source<View>(this), |
| 53 Details<ui::TextInputType>(&text_input_type)); | 53 Details<ui::TextInputType>(&text_input_type)); |
| 54 } | 54 } |
| 55 return status; | 55 return status; |
| 56 } | 56 } |
| 57 #endif | 57 #endif |
| 58 | 58 |
| 59 bool BrowserRootView::GetDropFormats( | 59 bool BrowserRootView::GetDropFormats( |
| 60 int* formats, | 60 int* formats, |
| 61 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) { | 61 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 AutocompleteMatch match; | 187 AutocompleteMatch match; |
| 188 browser_view_->browser()->profile()->GetAutocompleteClassifier()->Classify( | 188 browser_view_->browser()->profile()->GetAutocompleteClassifier()->Classify( |
| 189 text, string16(), false, false, &match, NULL); | 189 text, string16(), false, false, &match, NULL); |
| 190 if (!match.destination_url.is_valid()) | 190 if (!match.destination_url.is_valid()) |
| 191 return false; | 191 return false; |
| 192 | 192 |
| 193 if (url) | 193 if (url) |
| 194 *url = match.destination_url; | 194 *url = match.destination_url; |
| 195 return true; | 195 return true; |
| 196 } | 196 } |
| OLD | NEW |