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

Side by Side Diff: chrome/browser/ui/views/frame/browser_root_view.cc

Issue 7324029: Fix the bug of the hide key on Omnibox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 5 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
« no previous file with comments | « no previous file | views/widget/root_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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/notification_service.h" 22 #include "content/common/notification_service.h"
23 #include "content/common/notification_type.h" 23 #include "content/common/notification_type.h"
24 #include "views/ime/text_input_client.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 views::View* handler = touch_pressed_handler(); 41 if (event.type() != ui::ET_TOUCH_PRESSED)
42 if (!handler)
43 return status; 42 return status;
44 views::TextInputClient* text_input_client = handler->GetTextInputClient(); 43
45 if (!text_input_client) 44 views::InputMethod* input_method = GetInputMethod();
45 if (!input_method)
46 return status; 46 return status;
47 ui::TextInputType text_input_type = text_input_client->GetTextInputType(); 47
48 ui::TextInputType text_input_type = input_method->GetTextInputType();
48 if (text_input_type != ui::TEXT_INPUT_TYPE_NONE) { 49 if (text_input_type != ui::TEXT_INPUT_TYPE_NONE) {
49 NotificationService::current()->Notify( 50 NotificationService::current()->Notify(
50 NotificationType::EDITABLE_ELEMENT_TOUCHED, 51 NotificationType::EDITABLE_ELEMENT_TOUCHED,
51 Source<View>(this), 52 Source<View>(this),
52 Details<ui::TextInputType>(&text_input_type)); 53 Details<ui::TextInputType>(&text_input_type));
53 } 54 }
54 return status; 55 return status;
55 } 56 }
56 #endif 57 #endif
57 58
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 AutocompleteMatch match; 187 AutocompleteMatch match;
187 browser_view_->browser()->profile()->GetAutocompleteClassifier()->Classify( 188 browser_view_->browser()->profile()->GetAutocompleteClassifier()->Classify(
188 text, string16(), false, false, &match, NULL); 189 text, string16(), false, false, &match, NULL);
189 if (!match.destination_url.is_valid()) 190 if (!match.destination_url.is_valid())
190 return false; 191 return false;
191 192
192 if (url) 193 if (url)
193 *url = match.destination_url; 194 *url = match.destination_url;
194 return true; 195 return true;
195 } 196 }
OLDNEW
« no previous file with comments | « no previous file | views/widget/root_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698