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

Side by Side Diff: chrome/browser/ui/views/compact_nav/compact_navigation_bar.cc

Issue 6893046: added CTRL+Click and SHIFT+Click handler for context menu, Back and Forward. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: make this patch applicable to the latest trunk Created 9 years, 6 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
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/compact_nav/compact_navigation_bar.h" 5 #include "chrome/browser/ui/views/compact_nav/compact_navigation_bar.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/app/chrome_dll_resource.h" 9 #include "chrome/app/chrome_dll_resource.h"
10 #include "chrome/browser/event_disposition.h"
10 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/ui/browser.h" 12 #include "chrome/browser/ui/browser.h"
12 #include "chrome/browser/ui/browser_window.h" 13 #include "chrome/browser/ui/browser_window.h"
13 #include "chrome/browser/ui/toolbar/back_forward_menu_model.h" 14 #include "chrome/browser/ui/toolbar/back_forward_menu_model.h"
14 #include "chrome/browser/ui/view_ids.h" 15 #include "chrome/browser/ui/view_ids.h"
15 #include "chrome/browser/ui/views/event_utils.h"
16 #include "chrome/browser/ui/views/frame/browser_view.h" 16 #include "chrome/browser/ui/views/frame/browser_view.h"
17 #include "chrome/browser/ui/views/theme_background.h" 17 #include "chrome/browser/ui/views/theme_background.h"
18 #include "content/browser/tab_contents/tab_contents.h" 18 #include "content/browser/tab_contents/tab_contents.h"
19 #include "grit/generated_resources.h" 19 #include "grit/generated_resources.h"
20 #include "grit/theme_resources.h" 20 #include "grit/theme_resources.h"
21 #include "grit/theme_resources_standard.h" 21 #include "grit/theme_resources_standard.h"
22 #include "ui/base/l10n/l10n_util.h" 22 #include "ui/base/l10n/l10n_util.h"
23 #include "ui/base/resource/resource_bundle.h" 23 #include "ui/base/resource/resource_bundle.h"
24 #include "ui/base/theme_provider.h" 24 #include "ui/base/theme_provider.h"
25 #include "ui/gfx/canvas.h" 25 #include "ui/gfx/canvas.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 forward_->SetBounds(curx, 0, button_size.width(), height()); 140 forward_->SetBounds(curx, 0, button_size.width(), height());
141 } 141 }
142 142
143 //////////////////////////////////////////////////////////////////////////////// 143 ////////////////////////////////////////////////////////////////////////////////
144 // views::ButtonListener implementation. 144 // views::ButtonListener implementation.
145 145
146 void CompactNavigationBar::ButtonPressed( 146 void CompactNavigationBar::ButtonPressed(
147 views::Button* sender, const views::Event& event) { 147 views::Button* sender, const views::Event& event) {
148 browser_view_->browser()->ExecuteCommandWithDisposition( 148 browser_view_->browser()->ExecuteCommandWithDisposition(
149 sender->tag(), 149 sender->tag(),
150 event_utils::DispositionFromEventFlags(sender->mouse_event_flags())); 150 browser::DispositionFromEventFlags(sender->mouse_event_flags()));
151 } 151 }
152 152
153 //////////////////////////////////////////////////////////////////////////////// 153 ////////////////////////////////////////////////////////////////////////////////
154 // CommandUpdater::CommandObserver implementation. 154 // CommandUpdater::CommandObserver implementation.
155 void CompactNavigationBar::EnabledStateChangedForCommand(int id, bool enabled) { 155 void CompactNavigationBar::EnabledStateChangedForCommand(int id, bool enabled) {
156 switch (id) { 156 switch (id) {
157 case IDC_BACK: 157 case IDC_BACK:
158 back_->SetEnabled(enabled); 158 back_->SetEnabled(enabled);
159 break; 159 break;
160 case IDC_FORWARD: 160 case IDC_FORWARD:
(...skipping 16 matching lines...) Expand all
177 177
178 forward_->SetImage(views::CustomButton::BS_NORMAL, 178 forward_->SetImage(views::CustomButton::BS_NORMAL,
179 tp->GetBitmapNamed(IDR_FORWARD)); 179 tp->GetBitmapNamed(IDR_FORWARD));
180 forward_->SetImage(views::CustomButton::BS_HOT, 180 forward_->SetImage(views::CustomButton::BS_HOT,
181 tp->GetBitmapNamed(IDR_FORWARD_H)); 181 tp->GetBitmapNamed(IDR_FORWARD_H));
182 forward_->SetImage(views::CustomButton::BS_PUSHED, 182 forward_->SetImage(views::CustomButton::BS_PUSHED,
183 tp->GetBitmapNamed(IDR_FORWARD_P)); 183 tp->GetBitmapNamed(IDR_FORWARD_P));
184 forward_->SetImage(views::CustomButton::BS_DISABLED, 184 forward_->SetImage(views::CustomButton::BS_DISABLED,
185 tp->GetBitmapNamed(IDR_FORWARD_D)); 185 tp->GetBitmapNamed(IDR_FORWARD_D));
186 } 186 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698