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

Side by Side Diff: chrome/browser/ui/views/dropdown_bar_host.cc

Issue 664703003: Stash: hacks to get MacViews chrome browser window working (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Created 6 years 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/dropdown_bar_host.h" 5 #include "chrome/browser/ui/views/dropdown_bar_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "chrome/browser/ui/view_ids.h" 9 #include "chrome/browser/ui/view_ids.h"
10 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" 10 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 // Initialize the host. 45 // Initialize the host.
46 host_.reset(new views::Widget); 46 host_.reset(new views::Widget);
47 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); 47 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL);
48 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 48 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
49 params.parent = browser_view_->GetWidget()->GetNativeView(); 49 params.parent = browser_view_->GetWidget()->GetNativeView();
50 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 50 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
51 host_->Init(params); 51 host_->Init(params);
52 host_->SetContentsView(view_); 52 host_->SetContentsView(view_);
53 53
54 #if defined(USE_AURA)
54 SetHostViewNative(host_view); 55 SetHostViewNative(host_view);
56 #endif
55 57
56 // Start listening to focus changes, so we can register and unregister our 58 // Start listening to focus changes, so we can register and unregister our
57 // own handler for Escape. 59 // own handler for Escape.
58 focus_manager_ = host_->GetFocusManager(); 60 focus_manager_ = host_->GetFocusManager();
59 if (focus_manager_) { 61 if (focus_manager_) {
60 focus_manager_->AddFocusChangeListener(this); 62 focus_manager_->AddFocusChangeListener(this);
61 } else { 63 } else {
62 // In some cases (see bug http://crbug.com/17056) it seems we may not have 64 // In some cases (see bug http://crbug.com/17056) it seems we may not have
63 // a focus manager. Please reopen the bug if you hit this. 65 // a focus manager. Please reopen the bug if you hit this.
64 NOTREACHED(); 66 NOTREACHED();
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 escape, ui::AcceleratorManager::kNormalPriority, this); 219 escape, ui::AcceleratorManager::kNormalPriority, this);
218 esc_accel_target_registered_ = true; 220 esc_accel_target_registered_ = true;
219 } 221 }
220 222
221 void DropdownBarHost::UnregisterAccelerators() { 223 void DropdownBarHost::UnregisterAccelerators() {
222 DCHECK(esc_accel_target_registered_); 224 DCHECK(esc_accel_target_registered_);
223 ui::Accelerator escape(ui::VKEY_ESCAPE, ui::EF_NONE); 225 ui::Accelerator escape(ui::VKEY_ESCAPE, ui::EF_NONE);
224 focus_manager_->UnregisterAccelerator(escape, this); 226 focus_manager_->UnregisterAccelerator(escape, this);
225 esc_accel_target_registered_ = false; 227 esc_accel_target_registered_ = false;
226 } 228 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/dropdown_bar_host.h ('k') | chrome/browser/ui/views/dropdown_bar_host_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698