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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc

Issue 8508055: Move views::Accelerator to ui in order to use it from aura code. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 9 years, 1 month 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
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/bookmarks/bookmark_bubble_view.h" 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h"
6 6
7 #include "base/string16.h" 7 #include "base/string16.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"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 DCHECK(bookmark_bubble_ == this); 129 DCHECK(bookmark_bubble_ == this);
130 bookmark_bubble_ = NULL; 130 bookmark_bubble_ = NULL;
131 131
132 content::NotificationService::current()->Notify( 132 content::NotificationService::current()->Notify(
133 chrome::NOTIFICATION_BOOKMARK_BUBBLE_HIDDEN, 133 chrome::NOTIFICATION_BOOKMARK_BUBBLE_HIDDEN,
134 content::Source<Profile>(profile_->GetOriginalProfile()), 134 content::Source<Profile>(profile_->GetOriginalProfile()),
135 content::NotificationService::NoDetails()); 135 content::NotificationService::NoDetails());
136 } 136 }
137 137
138 bool BookmarkBubbleView::AcceleratorPressed( 138 bool BookmarkBubbleView::AcceleratorPressed(
139 const views::Accelerator& accelerator) { 139 const ui::Accelerator& accelerator) {
140 if (accelerator.key_code() == ui::VKEY_RETURN) { 140 if (accelerator.key_code() == ui::VKEY_RETURN) {
141 if (edit_button_->HasFocus()) 141 if (edit_button_->HasFocus())
142 HandleButtonPressed(edit_button_); 142 HandleButtonPressed(edit_button_);
143 else 143 else
144 HandleButtonPressed(close_button_); 144 HandleButtonPressed(close_button_);
145 return true; 145 return true;
146 } else if (accelerator.key_code() == ui::VKEY_ESCAPE) { 146 } else if (accelerator.key_code() == ui::VKEY_ESCAPE) {
147 remove_bookmark_ = newly_bookmarked_; 147 remove_bookmark_ = newly_bookmarked_;
148 apply_edits_ = false; 148 apply_edits_ = false;
149 } 149 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 228
229 layout->StartRow(0, 2); 229 layout->StartRow(0, 2);
230 layout->AddView(combobox_label); 230 layout->AddView(combobox_label);
231 layout->AddView(parent_combobox_); 231 layout->AddView(parent_combobox_);
232 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing); 232 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing);
233 233
234 layout->StartRow(0, 3); 234 layout->StartRow(0, 3);
235 layout->AddView(edit_button_); 235 layout->AddView(edit_button_);
236 layout->AddView(close_button_); 236 layout->AddView(close_button_);
237 237
238 AddAccelerator(views::Accelerator(ui::VKEY_RETURN, 0)); 238 AddAccelerator(ui::Accelerator(ui::VKEY_RETURN, 0));
239 } 239 }
240 240
241 BookmarkBubbleView::BookmarkBubbleView(views::View* anchor_view, 241 BookmarkBubbleView::BookmarkBubbleView(views::View* anchor_view,
242 Profile* profile, 242 Profile* profile,
243 const GURL& url, 243 const GURL& url,
244 bool newly_bookmarked) 244 bool newly_bookmarked)
245 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT, kColor), 245 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT, kColor),
246 profile_(profile), 246 profile_(profile),
247 url_(url), 247 url_(url),
248 newly_bookmarked_(newly_bookmarked), 248 newly_bookmarked_(newly_bookmarked),
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 const BookmarkNode* new_parent = 331 const BookmarkNode* new_parent =
332 parent_model_.GetNodeAt(parent_combobox_->selected_item()); 332 parent_model_.GetNodeAt(parent_combobox_->selected_item());
333 if (new_parent != node->parent()) { 333 if (new_parent != node->parent()) {
334 UserMetrics::RecordAction( 334 UserMetrics::RecordAction(
335 UserMetricsAction("BookmarkBubble_ChangeParent")); 335 UserMetricsAction("BookmarkBubble_ChangeParent"));
336 model->Move(node, new_parent, new_parent->child_count()); 336 model->Move(node, new_parent, new_parent->child_count());
337 } 337 }
338 } 338 }
339 } 339 }
340 } 340 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h ('k') | chrome/browser/ui/views/bubble/bubble.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698