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

Side by Side Diff: chrome/browser/cocoa/location_bar_view_mac.mm

Issue 172082: Create new event_utils.h file for Cocoa-specific event to WindowOpenDispositi... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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 | « chrome/browser/cocoa/infobar_controller.mm ('k') | chrome/browser/cocoa/test_event_utils.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #import "chrome/browser/cocoa/location_bar_view_mac.h" 5 #import "chrome/browser/cocoa/location_bar_view_mac.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "chrome/app/chrome_dll_resource.h" 8 #include "chrome/app/chrome_dll_resource.h"
9 #include "chrome/browser/alternate_nav_url_fetcher.h" 9 #include "chrome/browser/alternate_nav_url_fetcher.h"
10 #import "chrome/browser/app_controller_mac.h" 10 #import "chrome/browser/app_controller_mac.h"
11 #import "chrome/browser/autocomplete/autocomplete_edit_view_mac.h" 11 #import "chrome/browser/autocomplete/autocomplete_edit_view_mac.h"
12 #include "chrome/browser/cocoa/event_utils.h"
12 #include "chrome/browser/command_updater.h" 13 #include "chrome/browser/command_updater.h"
13 #import "chrome/common/cocoa_utils.h"
14 #include "third_party/skia/include/core/SkBitmap.h" 14 #include "third_party/skia/include/core/SkBitmap.h"
15 15
16 // TODO(shess): This code is mostly copied from the gtk 16 // TODO(shess): This code is mostly copied from the gtk
17 // implementation. Make sure it's all appropriate and flesh it out. 17 // implementation. Make sure it's all appropriate and flesh it out.
18 18
19 LocationBarViewMac::LocationBarViewMac(AutocompleteTextField* field, 19 LocationBarViewMac::LocationBarViewMac(AutocompleteTextField* field,
20 CommandUpdater* command_updater, 20 CommandUpdater* command_updater,
21 ToolbarModel* toolbar_model, 21 ToolbarModel* toolbar_model,
22 Profile* profile) 22 Profile* profile)
23 : edit_view_(new AutocompleteEditViewMac(this, toolbar_model, profile, 23 : edit_view_(new AutocompleteEditViewMac(this, toolbar_model, profile,
(...skipping 18 matching lines...) Expand all
42 // TODO(shess): Verify that this TODO is TODONE. 42 // TODO(shess): Verify that this TODO is TODONE.
43 // TODO(rohitrao): Fix this to return different types once autocomplete and 43 // TODO(rohitrao): Fix this to return different types once autocomplete and
44 // the onmibar are implemented. For now, any URL that comes from the 44 // the onmibar are implemented. For now, any URL that comes from the
45 // LocationBar has to have been entered by the user, and thus is of type 45 // LocationBar has to have been entered by the user, and thus is of type
46 // PageTransition::TYPED. 46 // PageTransition::TYPED.
47 PageTransition::Type LocationBarViewMac::GetPageTransition() const { 47 PageTransition::Type LocationBarViewMac::GetPageTransition() const {
48 return transition_; 48 return transition_;
49 } 49 }
50 50
51 void LocationBarViewMac::AcceptInput() { 51 void LocationBarViewMac::AcceptInput() {
52 WindowOpenDisposition disposition = event_utils::DispositionFromEventFlags( 52 WindowOpenDisposition disposition =
53 [[NSApp currentEvent] modifierFlags]); 53 event_utils::WindowOpenDispositionFromNSEvent([NSApp currentEvent]);
54 AcceptInputWithDisposition(disposition); 54 AcceptInputWithDisposition(disposition);
55 } 55 }
56 56
57 void LocationBarViewMac::AcceptInputWithDisposition( 57 void LocationBarViewMac::AcceptInputWithDisposition(
58 WindowOpenDisposition disposition) { 58 WindowOpenDisposition disposition) {
59 edit_view_->AcceptInput(disposition, false); 59 edit_view_->AcceptInput(disposition, false);
60 } 60 }
61 61
62 void LocationBarViewMac::FocusLocation() { 62 void LocationBarViewMac::FocusLocation() {
63 edit_view_->FocusLocation(); 63 edit_view_->FocusLocation();
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 133 }
134 134
135 void LocationBarViewMac::Revert() { 135 void LocationBarViewMac::Revert() {
136 edit_view_->RevertAll(); 136 edit_view_->RevertAll();
137 } 137 }
138 138
139 int LocationBarViewMac::PageActionVisibleCount() { 139 int LocationBarViewMac::PageActionVisibleCount() {
140 NOTIMPLEMENTED(); 140 NOTIMPLEMENTED();
141 return -1; 141 return -1;
142 } 142 }
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/infobar_controller.mm ('k') | chrome/browser/cocoa/test_event_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698