summaryrefslogtreecommitdiffstats
path: root/win8/metro_driver/chrome_app_view_ash.cc
diff options
context:
space:
mode:
Diffstat (limited to 'win8/metro_driver/chrome_app_view_ash.cc')
-rw-r--r--win8/metro_driver/chrome_app_view_ash.cc59
1 files changed, 28 insertions, 31 deletions
diff --git a/win8/metro_driver/chrome_app_view_ash.cc b/win8/metro_driver/chrome_app_view_ash.cc
index 15158dd..2615ba6 100644
--- a/win8/metro_driver/chrome_app_view_ash.cc
+++ b/win8/metro_driver/chrome_app_view_ash.cc
@@ -7,11 +7,13 @@
#include <corewindow.h>
#include <shellapi.h>
+#include <stdint.h>
#include <windows.foundation.h>
#include "base/bind.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "base/single_thread_task_runner.h"
@@ -207,7 +209,7 @@ class ChromeChannelListener : public IPC::Listener {
base::Unretained(app_view_), shortcut, url));
}
- void OnSetCursor(int64 cursor) {
+ void OnSetCursor(int64_t cursor) {
ui_task_runner_->PostTask(
FROM_HERE,
base::Bind(&ChromeAppViewAsh::OnSetCursor, base::Unretained(app_view_),
@@ -251,7 +253,7 @@ class ChromeChannelListener : public IPC::Listener {
}
void OnImeTextInputClientChanged(
- const std::vector<int32>& input_scopes,
+ const std::vector<int32_t>& input_scopes,
const std::vector<metro_viewer::CharacterBounds>& character_bounds) {
ui_task_runner_->PostTask(
FROM_HERE, base::Bind(&ChromeAppViewAsh::OnImeUpdateTextInputClient,
@@ -282,8 +284,8 @@ void RunMessageLoop(winui::Core::ICoreDispatcher* dispatcher) {
}
// Helper to return the state of the shift/control/alt keys.
-uint32 GetKeyboardEventFlags() {
- uint32 flags = 0;
+uint32_t GetKeyboardEventFlags() {
+ uint32_t flags = 0;
if (ui::win::IsShiftPressed())
flags |= ui::EF_SHIFT_DOWN;
if (ui::win::IsCtrlPressed())
@@ -440,9 +442,7 @@ class ChromeAppViewAsh::PointerInfoHandler {
return IsType(windevs::Input::PointerDeviceType_Touch);
}
- int32 wheel_delta() const {
- return wheel_delta_;
- }
+ int32_t wheel_delta() const { return wheel_delta_; }
// Identifies the button that changed.
ui::EventFlags changed_button() const {
@@ -464,16 +464,14 @@ class ChromeAppViewAsh::PointerInfoHandler {
}
}
- uint32 mouse_down_flags() const { return mouse_down_flags_; }
+ uint32_t mouse_down_flags() const { return mouse_down_flags_; }
int x() const { return x_; }
int y() const { return y_; }
- uint32 pointer_id() const {
- return pointer_id_;
- }
+ uint32_t pointer_id() const { return pointer_id_; }
- uint64 timestamp() const { return timestamp_; }
+ uint64_t timestamp() const { return timestamp_; }
winui::Input::PointerUpdateKind update_kind() const { return update_kind_; }
@@ -483,14 +481,14 @@ class ChromeAppViewAsh::PointerInfoHandler {
int x_;
int y_;
int wheel_delta_;
- uint32 pointer_id_;
+ uint32_t pointer_id_;
winui::Input::PointerUpdateKind update_kind_;
mswr::ComPtr<winui::Input::IPointerPoint> pointer_point_;
- uint64 timestamp_;
+ uint64_t timestamp_;
// Bitmask of ui::EventFlags corresponding to the buttons that are currently
// down.
- uint32 mouse_down_flags_;
+ uint32_t mouse_down_flags_;
// Set to true for a horizontal wheel message.
boolean is_horizontal_wheel_;
@@ -875,7 +873,7 @@ void ChromeAppViewAsh::OnImeCancelComposition() {
}
void ChromeAppViewAsh::OnImeUpdateTextInputClient(
- const std::vector<int32>& input_scopes,
+ const std::vector<int32_t>& input_scopes,
const std::vector<metro_viewer::CharacterBounds>& character_bounds) {
if (!text_service_)
return;
@@ -947,8 +945,8 @@ void ChromeAppViewAsh::OnInputSourceChanged() {
void ChromeAppViewAsh::OnCompositionChanged(
const base::string16& text,
- int32 selection_start,
- int32 selection_end,
+ int32_t selection_start,
+ int32_t selection_end,
const std::vector<metro_viewer::UnderlineInfo>& underlines) {
ui_channel_->Send(new MetroViewerHostMsg_ImeCompositionChanged(
text, selection_start, selection_end, underlines));
@@ -962,17 +960,17 @@ void ChromeAppViewAsh::SendMouseButton(int x,
int y,
int extra,
ui::EventType event_type,
- uint32 flags,
+ uint32_t flags,
ui::EventFlags changed_button,
bool is_horizontal_wheel) {
if (!ui_channel_)
return;
MetroViewerHostMsg_MouseButtonParams params;
- params.x = static_cast<int32>(x);
- params.y = static_cast<int32>(y);
- params.extra = static_cast<int32>(extra);
+ params.x = static_cast<int32_t>(x);
+ params.y = static_cast<int32_t>(y);
+ params.extra = static_cast<int32_t>(extra);
params.event_type = event_type;
- params.flags = static_cast<int32>(flags);
+ params.flags = static_cast<int32_t>(flags);
params.changed_button = changed_button;
params.is_horizontal_wheel = is_horizontal_wheel;
ui_channel_->Send(new MetroViewerHostMsg_MouseButton(params));
@@ -983,7 +981,7 @@ void ChromeAppViewAsh::GenerateMouseEventFromMoveIfNecessary(
ui::EventType event_type;
// For aura we want the flags to include the button that was released, thus
// we or the old and new.
- uint32 mouse_down_flags = pointer.mouse_down_flags() | mouse_down_flags_;
+ uint32_t mouse_down_flags = pointer.mouse_down_flags() | mouse_down_flags_;
mouse_down_flags_ = pointer.mouse_down_flags();
switch (pointer.update_kind()) {
case winui::Input::PointerUpdateKind_LeftButtonPressed:
@@ -1111,10 +1109,9 @@ HRESULT ChromeAppViewAsh::OnPointerReleased(
if (pointer.IsMouse()) {
mouse_down_flags_ = ui::EF_NONE;
SendMouseButton(pointer.x(), pointer.y(), 0, ui::ET_MOUSE_RELEASED,
- static_cast<uint32>(pointer.changed_button()) |
- GetKeyboardEventFlags(),
- pointer.changed_button(),
- pointer.is_horizontal_wheel());
+ static_cast<uint32_t>(pointer.changed_button()) |
+ GetKeyboardEventFlags(),
+ pointer.changed_button(), pointer.is_horizontal_wheel());
} else {
DCHECK(pointer.IsTouch());
ui_channel_->Send(new MetroViewerHostMsg_TouchUp(pointer.x(),
@@ -1206,7 +1203,7 @@ HRESULT ChromeAppViewAsh::OnAcceleratorKeyDown(
if (FAILED(hr))
return hr;
- uint32 keyboard_flags = GetKeyboardEventFlags();
+ uint32_t keyboard_flags = GetKeyboardEventFlags();
switch (event_type) {
case winui::Core::CoreAcceleratorKeyEventType_SystemCharacter:
@@ -1380,8 +1377,8 @@ HRESULT ChromeAppViewAsh::OnSizeChanged(winui::Core::ICoreWindow* sender,
RECT rect = {0};
::GetWindowRect(core_window_hwnd_, &rect);
- uint32 cx = static_cast<uint32>(rect.right - rect.left);
- uint32 cy = static_cast<uint32>(rect.bottom - rect.top);
+ uint32_t cx = static_cast<uint32_t>(rect.right - rect.left);
+ uint32_t cy = static_cast<uint32_t>(rect.bottom - rect.top);
DVLOG(1) << "Window size changed: width=" << cx << ", height=" << cy;
ui_channel_->Send(new MetroViewerHostMsg_WindowSizeChanged(cx, cy));