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

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

Issue 12620003: Fix copy/cut from menu when omnibox is focused (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 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
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_view_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 2648 matching lines...) Expand 10 before | Expand all | Expand 10 after
2659 2659
2660 DevToolsWindow* devtools_window = 2660 DevToolsWindow* devtools_window =
2661 DevToolsWindow::GetDockedInstanceForInspectedTab(contents); 2661 DevToolsWindow::GetDockedInstanceForInspectedTab(contents);
2662 if (devtools_window && 2662 if (devtools_window &&
2663 DoCutCopyPasteForWebContents(devtools_window->web_contents(), method)) { 2663 DoCutCopyPasteForWebContents(devtools_window->web_contents(), method)) {
2664 return; 2664 return;
2665 } 2665 }
2666 2666
2667 views::FocusManager* focus_manager = GetFocusManager(); 2667 views::FocusManager* focus_manager = GetFocusManager();
2668 views::View* focused = focus_manager->GetFocusedView(); 2668 views::View* focused = focus_manager->GetFocusedView();
2669 if (focused->GetClassName() == views::Textfield::kViewClassName) { 2669 if (focused->GetClassName() == views::Textfield::kViewClassName ||
2670 focused->GetClassName() == OmniboxViewViews::kViewClassName) {
2670 views::Textfield* textfield = static_cast<views::Textfield*>(focused); 2671 views::Textfield* textfield = static_cast<views::Textfield*>(focused);
2671 textfield->ExecuteCommand(command_id); 2672 textfield->ExecuteCommand(command_id);
2672 return; 2673 return;
2673 } 2674 }
2674 2675
2675 #if defined(OS_WIN) && !defined(USE_AURA) 2676 #if defined(OS_WIN) && !defined(USE_AURA)
2676 OmniboxView* omnibox_view = GetLocationBarView()->GetLocationEntry(); 2677 OmniboxView* omnibox_view = GetLocationBarView()->GetLocationEntry();
2677 if (omnibox_view->model()->has_focus()) { 2678 if (omnibox_view->model()->has_focus()) {
2678 OmniboxViewWin* omnibox_win = GetOmniboxViewWin(omnibox_view); 2679 OmniboxViewWin* omnibox_win = GetOmniboxViewWin(omnibox_view);
2679 ::SendMessage(omnibox_win->GetNativeView(), windows_msg_id, 0, 0); 2680 ::SendMessage(omnibox_win->GetNativeView(), windows_msg_id, 0, 0);
(...skipping 28 matching lines...) Expand all
2708 2709
2709 Browser* modal_browser = 2710 Browser* modal_browser =
2710 chrome::FindBrowserWithWebContents(active_dialog->web_contents()); 2711 chrome::FindBrowserWithWebContents(active_dialog->web_contents());
2711 if (modal_browser && (browser_ != modal_browser)) { 2712 if (modal_browser && (browser_ != modal_browser)) {
2712 modal_browser->window()->FlashFrame(true); 2713 modal_browser->window()->FlashFrame(true);
2713 modal_browser->window()->Activate(); 2714 modal_browser->window()->Activate();
2714 } 2715 }
2715 2716
2716 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); 2717 AppModalDialogQueue::GetInstance()->ActivateModalDialog();
2717 } 2718 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_view_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698